David Smalley
Administator
36 post(s)
|
We have just added a basic JSON and XML API.
Just hit any resource with the appropriate extensions/accept headers and you are away.
curl http://isitruby19.com/rails.json
{"code": {"name": "rails", "code_type": "gem", "rubyforge": "rails", "permalink": "http://isitruby19.com/rails", "summary": "Web-application framework with template engine, control-flow layer, and ORM.", "description": "Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick on top of either MySQL, PostgreSQL, or SQLite with eRuby-based templates.", "homepage": "http://www.rubyonrails.org"}}
curl http://isitruby19.com/hpricot/comments.json
[{"comment": {"name": "Jai-Gouk Kim", "body": "Ubuntu 8.1, x86, installed from github.", "works_for_me": true, "url": "http://jaigouk.blogspot.com", "version": "0.9.198", "platform": {"name": "GNU/Linux"}}}, {"comment": {"name": "postmodern", "body": "gcc -I. -I/usr/include/ruby19-1.9.1/x86_64-linux -I/usr/include/ruby19-1.9.1/ruby/backward -I/usr/include/ruby19-1.9.1 -I. -DHAVE_STDIO_H -fPIC -O2 -g -Wall -Wno-parentheses -fPIC -o fast_xs.o -c fast_xs.c\r\nfast_xs.c: In function \u2018fast_xs\u2019:\r\nfast_xs.c:169: error: \u2018struct RArray\u2019 has no member named \u2018ptr\u2019\r\nfast_xs.c:170: error: \u2018struct RArray\u2019 has no member named \u2018len\u2019\r\nfast_xs.c:175: error: \u2018struct RArray\u2019 has no member named \u2018ptr\u2019\r\nfast_xs.c:176: error: \u2018struct RArray\u2019 has no member named \u2018len\u2019\r\nmake: *** [fast_xs.o] Error 1\r\n", "works_for_me": false, "url": "http://houseofpostmodern.wordpress.com/", "version": "0.6.164", "platform": {"name": "GNU/Linux"}}}, {"comment": {"name": "Jeremy Kemper", "body": "fast_xs has been fixed: <a href="http://github.com/why/hpricot/commit/2cf87f4">http://github.com/why/hpricot/commit/2cf87f4</a>", "works_for_me": true, "url": "http://bitsweat.net/", "version": "0.6.171", "platform": {"name": "Mac OSX"}}}, {"comment": {"name": "Ryan Neufeld", "body": "Fails to install on building fast_xs.c", "works_for_me": true, "url": "", "version": "0.6.164", "platform": {"name": "Mac OSX"}}}, {"comment": {"name": "Rahoul Baruah", "body": "Installs but tests won't run", "works_for_me": false, "url": "http://www.brightbox.co.uk", "version": "0.6.164", "platform": {"name": "Mac OSX"}}}]
Just replace .json with .xml for an XML flavour.
You can also access the author model.
curl http://isitruby19.com/authors/why-the-lucky-sti…
{"author": {"name": "why the lucky stiff", "codes": [{"name": "hpricot", "permalink": "http://isitruby19.com/hpricot"}, {"name": "camping", "permalink": "http://isitruby19.com/camping"}, {"name": "metaid", "permalink": "http://isitruby19.com/metaid"}, {"name": "markaby", "permalink": "http://isitruby19.com/markaby"}], "permalink": "http://isitruby19.com/authors/why-the-lucky-stiff"}}
And carry out a search
curl http://isitruby19.com/codes.json?s=activemerchant
[{"code": {"name": "activemerchant", "code_type": "gem", "rubyforge": null, "permalink": "http://isitruby19.com/activemerchant", "summary": "Framework and tools for dealing with credit card transactions.", "description": null, "homepage": "http://activemerchant.org/"}}]
And list all the code…
curl http://isitruby19.com/codes.json?page=1
|
macarthy
3 post(s)
|
Maybe add an API to submit installed gems so we have some metric and the most important ones?
|
jkmcf
1 post(s)
|
Hopefully this doesn’t become a thorn in your hosting, but I just created Am I Ruby 1.9? on github.
It’s not scientific, but it may be a good starting point for people to check their installed gems.
Kevin
|