Skip to content

Commit

Permalink
Merge pull request #15 from sourcerer-io/develop
Browse files Browse the repository at this point in the history
Releasing latest changes
  • Loading branch information
sergey48k authored Aug 14, 2018
2 parents a1bc7f7 + 3d38960 commit 7c84bc6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Hall-Of-Fame

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

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.

**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.

## How it works

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.

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!
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!

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.

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

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

**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.
**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.

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

Expand All @@ -57,4 +59,4 @@ Contribute to Hall-of-fame by all means. Here is the live Hall-of-fame for this
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/4)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/4)
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/5)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/5)
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/6)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/6)
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/7)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/7)
[![](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/images/7)](https://sourcerer.io/fame/sergey48k/sourcerer-io/hall-of-fame/links/7)
15 changes: 13 additions & 2 deletions fame/github_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def __init__(self, message):


class RepoTracker:
KNOWN_BOTS = ['pyup-bot']

def configure(self, user, owner, repo,
sourcerer_api_origin=None,
sourcerer_api_secret=None,
Expand Down Expand Up @@ -214,6 +216,10 @@ def _update_latest_commits(self, repo, avatars):
except:
print('w Author, date, or avatar missing. Skipping %s' % sha)

if author in RepoTracker.KNOWN_BOTS:
print('i Skipping bot commit %s by %s' % (sha, author))
continue

commit = pb.Commit(sha=sha, timestamp=commit_date, username=author)
commits.append(commit)

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

for contrib in contributors[:20]:
username = contrib['login']
if username in RepoTracker.KNOWN_BOTS:
print('i Skipping bot in top contributors: %s' % username)
continue

committer = repo.top_contributors.add()
committer.username = contrib['login']
committer.username = username
committer.num_commits = contrib['contributions']
avatars[committer.username] = contrib['avatar_url']
avatars[username] = contrib['avatar_url']

def _update_new_contributors(self, repo):
repo.ClearField('new_contributors')
Expand Down

0 comments on commit 7c84bc6

Please sign in to comment.