Thursday, April 2, 2015

Feature of the Week: BibSonomy for Ruby!

Recently, we have published a BibSonomy client for Ruby that enables easy retrieval of posts with the popular programming language Ruby. The code is published on GitHub but also available as a Gem such that you can install it with a simple gem install bibsonomy. Using the client is as convenient as with the BibSonomy clients for other languages: just instantiate it with your user name and API key and then query BibSonomy:

require 'bibsonomy'
api = BibSonomy::API.new('yourusername', 'yourapikey', 'ruby')
posts = api.get_posts_for_user('jaeschke', 'publication', ['myown'], 0, 20)

This requests the first 20 publications of the user "jaeschke" that have the tag "myown". They are returned as ruby objects within a list.

We have also integrated the CSL rendering language such that with the following lines you can easily render posts in any of the thousands of style sheets available for CSL:

require 'bibsonomy/csl'
csl = BibSonomy::CSL.new('yourusername', 'yourapikey')
html = csl.render('jaeschke', ['myown'], 100)
print html

Feel free to contribute to the client by forking it.

Last but not least: If you like Jekyll, you can use it to render publication lists on your homepage directly from BibSonomy. Checkout the Jekyll plugin and the accompanying explanation on how to use it. With the right CSS you get a publication list that looks nice and quite similar to that from DBLP.

Happy programming with Ruby!