Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (16 sloc) 454 Bytes
#!/usr/bin/env ruby
#
# Download your CiteULike bibliography and strip
# unnecessary fields.
#
##### YOUR SETTINGS HERE #####
User = 'NickGasson'
BadFields = [:url]
##### NO NEED TO EDIT BELOW HERE #####
require 'net/http'
require 'uri'
require 'bibtex/parser'
bibtex = Net::HTTP.get URI.parse("http://www.citeulike.org/bibtex/user/#{User}")
BibTeX::Parser.parse_string(bibtex).map do |entry|
entry.reject_fields BadFields
end.save("#{User}.bib")