Class: QuickCite::CiteULike

Inherits:
Object
  • Object
show all
Defined in:
lib/quickcite/citeulike.rb

Constant Summary collapse

HOST =
"http://www.citeulike.org"
SEARCH_BASE =
"/json/search/all"
BIBTEX_OPTIONS =
"do_username_prefix=0&key_type=4&incl_amazon=1&clean_urls=1&smart_wrap=1&q="

Instance Method Summary collapse

Instance Method Details

#bibtex(identifier) ⇒ Object



26
27
# File 'lib/quickcite/citeulike.rb', line 26

def bibtex(identifier)
end

#search(query) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/quickcite/citeulike.rb', line 17

def search(query)
  http = Net::HTTP.new(HOST)
  request = Net::HTTP::Get.new(SEARCH_BASE)
  request.set_form_data({ "q" => query })
  response = http.request(request)
  js = JSON.parse(response.body)
  return js
end