Skip to content

Commit

Permalink
Detect empty profiles // ghuser-io/ghuser.io#190
Browse files Browse the repository at this point in the history
  • Loading branch information
lourot committed Jul 11, 2019
1 parent f013965 commit 79393a4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions findUsersToRemove.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@
if (file.endsWith('.json')) {
const user = new DbFile(path.join(data.users, file));
if (!user.ghuser_deleted_because && !user.ghuser_keep_because && !user.removed_from_github
&& now - Date.parse(user.ghuser_created_at) > minAgeMonths * 30 * 24 * 60 * 60 * 1000
&& !user.contribs.repos.length) {
users.push(user);
&& now - Date.parse(user.ghuser_created_at) > minAgeMonths * 30 * 24 * 60 * 60 * 1000) {
let isToBeRemoved = !user.contribs.repos.length;
if (!isToBeRemoved) {
const contribs = new DbFile(path.join(data.contribs, file));
let total_stars = 0;
for (const repo in contribs.repos) {
total_stars += contribs.repos[repo].stargazers_count;
}
isToBeRemoved = !total_stars;
}
if (isToBeRemoved) {
users.push(user);
}
}
}
}
Expand Down

0 comments on commit 79393a4

Please sign in to comment.