Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A web service for coderwall to look up the number of contributions a user has made to a particular repository
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config
lib
spec
views
.gitignore
.rvmrc
Gemfile
LICENSE.md
README.md
Rakefile
config.ru
test.db

README.md

Octocoder

About

Octocoder is a simple rack-based web service for use by Coderwall to identify users' repository-based achievements. E.g.

  • Riding the Rails - user has contributed to the Rails framework.
  • In the Wee Small Hours - user has contributed to the Sinatra framework.

Usage

In a nutshell, you'll query http://octocoder.heroku.com/rails/rails/leereilly and get the JSON response {"count":6} indicating that leereilly has made 6 contributions to the repository called rails owned by user rails.

Examples

See it in Action

Check out http://www.coderwall.com/leereilly...

Coderwall

Installation

Local installation

Prerequisites:

  • RVM
  • Bundler

Clone the repository

git clone git@github.com:leereilly/octocoder.git
cd octocoder

Install bundler and the required gems

gem install bundler     
bundle install

Set your database environment variable

export DATABASE_URL=mysql://octocoder:super-duper-password@mysql.github.com/octocoder

Run the tests

rake

If everything looks OK, launch the application

shotgun    

Installation on Heroku

There are 4 easy steps (if you've used Heroku before). Please refer to Heroku Dev Center for help with Heroku.

git clone git@github.com:leereilly/octocoder.git
cd octocoder
heroku create 
git push heroku master

Note About API Version

If you want to always use the latest API version, point to http://octocoder.heroku.com/:owner/:repo/:user

NB: This is usually considered bad practice i.e. if the API changes then your app might crash/burn/kill.

If you want to always hit version 2 of the API (current stable version) hit http://octocoder.heroku.com/v2/rails/rails/leereilly

Contributing

Contributions are welcome and encouraged! You know the drill.

  • Fork.
  • Commit code with tests.
  • Pull.

General guidelines

Any changes to the actual API that aren't backwards-compatible should be added to a new version.

Kudos

  • GitHub for being awesome and having a public API
  • Coderwall
  • Gems sinatra, mongo-mapper, shotgun, heroku, rest-client, json, rspec, rack-test and webrat

Bugs / Known Issues

  • This is hosted on a free Heroku account with only one dyno i.e. performance and availability not guaranteed.
  • The current GitHub API (Version 3) document doesn't list Contributor as an available resource; it may be modified/removed at any time :-o
  • More in the issues ^
  • The first time a repository is hit, all the contributors are cached. Subsequent calls will be faster.

Bugs

Something went wrong with that request. Please try again.