Skip to content

Commit 7c84bc6

Browse files
authored
Merge pull request #15 from sourcerer-io/develop
Releasing latest changes
2 parents a1bc7f7 + 3d38960 commit 7c84bc6

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# Hall-Of-Fame
22

3-
<img src="https://user-images.githubusercontent.com/20287615/43668986-d98186cc-9734-11e8-9c3e-3956a512be04.png" height="96px">
3+
<img src="https://user-images.githubusercontent.com/20287615/43668986-d98186cc-9734-11e8-9c3e-3956a512be04.png" width="680px">
44

55
Hall-of-fame helps you show some love to your contributors. It automatically highlights your new, trending, and top contributors, and updates every hour. You can put this widget anywhere inside your README, e.g. to "Contributing" section. No maintenance is required.
66

7+
**Until Aug 24th only:** We'll be happy to make a pull request with hall-of-fame for your repo. Instructions: sign in to (https://sourcerer.io) with your GitHub (so that hall-of-fame could use your GitHub token to update), and send us an email to [email protected] with the repo name. We'll take care of the rest.
8+
79
## How it works
810

911
Every hour, Hall-of-fame looks into recent commits of your repo using GitHub API. It then selects three categories of contributors: new (those who made their first commit to your repo in the last 7 days), trending (those with most commits in the last 7 days), and top (those with most commits of all time). It then selects up to three new contributors, up to 4 trending contributors, and if total is less than 7, it fill up the remaining spots with top contributors.
1012

11-
Each contributor in the Hall-of-fame is represented with their avatar, and a badge new/trending/top with the corresponding number of commits. Each avatar links to a contributor's profile. Which means that anyone has a chance to be prominently features on your README for some time!
13+
Each contributor in the Hall-of-fame is represented with their avatar, and a badge new/trending/top with the corresponding number of commits. Each avatar links to a contributor's profile. Which means that anyone has a chance to be prominently featured on your README for some time!
1214

1315
Hall-of-fame works with Sourcerer (https://sourcerer.io), but it's not required for your contributors. If a contributor has a Sourcerer profile, their Sourcerer avatar with a halo is used, and the avatar links to their Sourcerer profile. If they don't, an avatar based on their GitHub is used, and it is linked to their GitHub profile.
1416

@@ -36,7 +38,7 @@ Note that Hall-of-fame will use your GitHub token for hourly updates via GitHub
3638

3739
**Q:** Why do you only show 7 entries?
3840

39-
**A:** 7 is a lucky number. But seriously, recognition means that you stand out. It's hard to stand out in a crowd, so we limit to 7. If you stronly feel a different number is better, file an issue. We'll consider.
41+
**A:** 7 is a lucky number. But seriously, recognition means that you stand out. It's hard to stand out in a crowd, so we limit to 7. If you strongly feel a different number is better, file an issue. We'll consider.
4042

4143
**Q:** What is the reason to show new, trending, top, in this order?
4244

@@ -57,4 +59,4 @@ Contribute to Hall-of-fame by all means. Here is the live Hall-of-fame for this
5759
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/4)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/4)
5860
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/5)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/5)
5961
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/6)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/6)
60-
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/7)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/7)
62+
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/7)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/7)

fame/github_tracker.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def __init__(self, message):
3030

3131

3232
class RepoTracker:
33+
KNOWN_BOTS = ['pyup-bot']
34+
3335
def configure(self, user, owner, repo,
3436
sourcerer_api_origin=None,
3537
sourcerer_api_secret=None,
@@ -214,6 +216,10 @@ def _update_latest_commits(self, repo, avatars):
214216
except:
215217
print('w Author, date, or avatar missing. Skipping %s' % sha)
216218

219+
if author in RepoTracker.KNOWN_BOTS:
220+
print('i Skipping bot commit %s by %s' % (sha, author))
221+
continue
222+
217223
commit = pb.Commit(sha=sha, timestamp=commit_date, username=author)
218224
commits.append(commit)
219225

@@ -239,10 +245,15 @@ def _update_top_contributors(self, repo, avatars):
239245
contributors = self._get_json(r)
240246

241247
for contrib in contributors[:20]:
248+
username = contrib['login']
249+
if username in RepoTracker.KNOWN_BOTS:
250+
print('i Skipping bot in top contributors: %s' % username)
251+
continue
252+
242253
committer = repo.top_contributors.add()
243-
committer.username = contrib['login']
254+
committer.username = username
244255
committer.num_commits = contrib['contributions']
245-
avatars[committer.username] = contrib['avatar_url']
256+
avatars[username] = contrib['avatar_url']
246257

247258
def _update_new_contributors(self, repo):
248259
repo.ClearField('new_contributors')

0 commit comments

Comments
 (0)