Module: GithubContributionsApi
- Defined in:
- lib/github_contributions_api.rb,
lib/github_contributions_api/version.rb
Overview
A ruby interface to the GitHub Contributions Archive API (https://githubcontributions.io). To the author's knowlege, this API is undocumented.
Constant Summary collapse
- URL_BASE =
The prexix for all GitHub Contributions API endpoints.
"https://githubcontributions.io/api"
- VERSION =
The current version of this library. Follows semantic versioning (http://semver.org/).
"1.0.0"
Class Method Summary collapse
-
.user(github_username) ⇒ Hash
Get information about a given github user.
-
.user_events(github_username, options = {}) ⇒ Hash
Get events for a given github user.
Class Method Details
.user(github_username) ⇒ Hash
Get information about a given github user.
14 15 16 17 18 |
# File 'lib/github_contributions_api.rb', line 14 def self.user(github_username) request_url = "#{URL_BASE}/user/#{github_username}" response = HTTParty.get(request_url) JSON.parse(response.body) end |
.user_events(github_username, options = {}) ⇒ Hash
Get events for a given github user.
28 29 30 31 32 33 |
# File 'lib/github_contributions_api.rb', line 28 def self.user_events(github_username, = {}) page_number = [:page] || 1 request_url = "#{URL_BASE}/user/#{github_username}/events/#{page_number}" response = HTTParty.get(request_url) JSON.parse(response.body) end |