Coder Social home page Coder Social logo

bcherny / contributor.io Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 380 KB

Fetch counts of a user's contributions to various platforms (Github, NPM, Gems, CPAN, Nuget, ...)

Home Page: contributor.io

CoffeeScript 62.83% CSS 26.32% JavaScript 9.54% Shell 1.31%

contributor.io's Introduction

contributor.io

Build Status

Fetch counts of a user's contributions to various platforms (Github, NPM, Gem, CPAN, Nuget, ...)

Platform support

Current

  • Github
  • NPM
  • Rubygems
  • CPAN
  • Nuget

Future

  • Bower
  • Component

Usage

...Via API

Send a GET request to contributor.io/api with each platform/username you'd like as a query parameter.

CLI example

JavaScript example

...As a server

# install dependencies
npm install

# start server
node server

# send a request!
curl "localhost:5000/api?github=myGithubUsername&npm=myNpmUsername"
# => { github: 42, npm: 66 }

To add Github authentication (optional, increase request limit):

  1. Register a Github Application to receive an oauth2 id and secret.

  2. Define process.env.github_oauth_id and process.env.github_oauth_secret somewhere (eg. at the top of contributor.coffee) and set them equal to the keys you got in Step #1.

  3. Define process.env.github_user, and set it equal to the username you want requests to be made under (defaults to the username queried).

...Or as a package

# install dependencies
npm install

And in your (coffee)script:

contributor = require 'contributor.io'

contributor
	gem: 'bcherny'
	github: 'eighttrackmind'
	npm: 'bcherny'
	cpan: 'fayland'
	nuget: 'microsoft'
.then (counts) ->

	# returns an object with counts, eg.:
	# {
	#	gem: 20
	#	github: 50
	#	npm: 45
	#	cpan: 67
	#   nuget: 818
	# }

Get supported platforms

contributor = require 'contributor.io'

contributor.support #=> returns an array of supported platforms

Environment support

  • Node
  • CommonJS

Contributing platform support

  1. Publish an NPM module which exports a single function that:
    • Accepts one or more arguments. The first must be the username and the rest must be optional.
    • Returns a deferred promise.
    • A resolved promise must return a single Number (aka. the number of contributions).
    • A rejected promise can return anything, but should ideally be a descriptive Object.
    • Ensure that your module is unit tested, and that promises are resolved and rejected appropriately.
  2. Fork contributor.io.
  3. Install your dependency with npm install --save myNewModuleName.
  4. Require your module in the list at the top of contributor.coffee.
  5. Add a human-readable description to the list at the top of index.coffee.
  6. Add it to the list of supported modules in README.md, and as a keyword in package.json.
  7. Commit and send a pull request! :)

contributor.io's People

Contributors

bcherny avatar fayland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fayland

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.