BibSonomy
BibSonomy client for Ruby
Installation
Add this line to your application's Gemfile:
gem 'bibsonomy'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bibsonomy
Usage
Getting posts from BibSonomy:
require 'bibsonomy'
api = BibSonomy::API.new('yourusername', 'yourapikey', 'ruby')
posts = api.get_posts_for_user('jaeschke', 'publication', ['myown'], 0, 20)
Rendering posts with CSL:
require 'bibsonomy/csl'
csl = BibSonomy::CSL.new('yourusername', 'yourapikey')
html = csl.render('jaeschke', ['myown'], 100)
print html
A command line wrapper to the CSL renderer:
#!/usr/bin/ruby
require 'bibsonomy/csl'
print BibSonomy::main(ARGV)
Testing
Get an API-Key from https://www.bibsonomy.org/settings?selTab=1 and then run the following commands:
export BIBSONOMY_USER_NAME="yourusername"
export BIBSONOMY_API_KEY="yourapikey"
bundle exec rake test
Supported API Calls
-
get_post
: post details -
get_posts_for_user
: posts for a user -
get_posts_for_group
: posts for a group (= posts of the group members) -
get_document
: documents for post -
get_document_preview
: preview image for a document -
get_posts
: posts for a user or group
Jekyll
This gem is used by the BibSonomy plugin for Jekyll to render post lists in Jekyll web sites. For an example output, have a look at my publication list.
Contributing
- Fork it ( https://github.com/rjoberon/bibsonomy-ruby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request