Skip to content

Instantly share code, notes, and snippets.

@truffaut
Created February 20, 2014 19:33
Show Gist options
  • Save truffaut/9121475 to your computer and use it in GitHub Desktop.
Save truffaut/9121475 to your computer and use it in GitHub Desktop.
require "json"
require 'unirest'
require 'pry'
module GHFeed
class RepoInfo
def self.get_repo_data(username, reponame)
response = Unirest::get("https://api.github.com/repos/#{username}/#{reponame}/commits", auth:{:user=>ENV['USERNAME'], :password=>ENV['PASSWORD']})
response.body
end
end
class UserInfo
def self.gravatar_url(username = "rails")
response = Unirest::get("https://api.github.com/users/#{username}", auth:{:user=>ENV['USERNAME'], :password=>ENV['PASSWORD']})
user = response.body
"https://secure.gravatar.com/avatar/#{user["gravatar_id"]}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment