Skip to content
Akshay Sharma edited this page Mar 25, 2015 · 3 revisions

Github.js

Github.js is a JavaScript plugin over GitHub APIs v3. It gives an easy way to feature your GitHub open-source contributions on your website or portfolio.

It provides widgets with simple UI featuring profile details and stream of public activities. Three types of useful widgets:

Demo

Click here for live demo.

#Dependency

The plugin has hard dependency on underscore.js(~v1.6.0). You can download it from here.

Installation

Add github.js and github.css to your project. Download.

<link rel='stylesheet' href='github.css'/>

// Add underscore.js 
<script type="text/javascript" src="underscore-min.js"></script>
<script type="text/javascript" src='github.js'></script>

Github.js is available via bower and npm.

$ bower install --save githubjs
$ npm install --save githubjs

Authorization

GitHub APIs have rate limit on the number of requests a user can make. An Authenticated user can make upto 5,000 requests per hour. But, unauthenticated user can only make 60 requests per hour. Unauthenticated requests are associated with your IP address. Therefore, authenticated requests are always preferred. All the widgets support OAuth authorization protocol of GitHub.

You can pass this token with other parameters like:

Github.userProfile({
  username: "jashkenas",
  OAuth: 'OAUTH-TOKEN',
  selector: ".user-1"
});

You can create your personal access token here.

Clone this wiki locally