BibSonomy client for Ruby
Add this line to your application's Gemfile:
gem 'bibsonomy'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bibsonomy
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)
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
get_post
: post detailsget_posts_for_user
: posts for a userget_posts_for_group
: posts for a group (= posts of the group members)get_document
: documents for postget_document_preview
: preview image for a documentget_posts
: posts for a user or group
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.
- 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