Skip to content

Instantly share code, notes, and snippets.

@lennartkoopmann
Created January 27, 2009 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lennartkoopmann/53423 to your computer and use it in GitHub Desktop.
Save lennartkoopmann/53423 to your computer and use it in GitHub Desktop.
helper_method :get_last_commit
def get_last_commit
require 'cobravsmongoose'
require 'open-uri'
response = open("http://github.com/api/v1/xml/lennartkoopmann/scopeport-server/commits/master").read
commits = CobraVsMongoose.xml_to_hash(response)
author_name = commits["commits"]["commit"][0]["author"]["name"]["$"]
message = commits["commits"]["commit"][0]["message"]["$"]
url = commits["commits"]["commit"][0]["url"]["$"]
date = commits["commits"]["commit"][0]["committed-date"]["$"]
return "\"#{message}\" at #{date} by #{author_name} - <a href=\"#{url}\">more information</a>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment