Socket
Book a DemoInstallSign in
Socket

worldcat

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worldcat

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

= WorldCat Search API

A WorldCat API for Ruby to interact with WorldCat search webservices. http://www.worldcat.org

== Usage

require 'worldcat'

client = WorldCat.new '[api_key]'

Get Atom or RSS response from an OpenSearch

atom = client.open_search :query => "Civil War" puts atom.feed.title puts atom.entries.first.author

Get MARC XML or Dublin Core from a SRU CQL query

cql = 'srw.kw="civil war" and (srw.su="antietam" or srw.su="sharpsburg")'

records = client.sru_search :query => cql, :format => "marcxml" for record in records # print out field 245 subfield a puts record['245']['a'] end

If you'd like to use another implementation, the raw response is available:

client.raw_response

A faster way?

rss = WorldCat.new.open_search :q => "Globalization", :format => "rss", :wskey => '[api_key]'

For more information, please have a look at the documentation or the test cases.

== Installation

gem install worldcat

== Why?

The 'wcapi' gem does not satisfy several points, so another version is justified for many reasons:

  • It is better to use a RSS Ruby implementation, actually SimpleRSS, to get Atom or RSS response.
  • It is better to use the MARC Ruby implementation to get MARC XML or Dublin Core response from a SRU CQL search or other search.
  • Unit testing is great.

== What this API can do

  • Send searches in OpenSearch or SRU CQL syntax.
  • Receive OpenSearch responses in RSS or Atom format (both are a SimpleRSS object).
  • Receive SRU responses in an array of MARC::Record or Dublin Core (REXML::Document).
  • Receive a MARC::Record for a single OCLC record.
  • Receive a REXML::Document for geographically-sorted library holdings information.
  • Receive a HTML formatted String for standard bibliographic citation formats (APA, Chicago, Harvard, MLA, and Turabian).

== To do

  • Use SRU gem to get response from sru_search.

== Contribution

Feel free to fork and send me a pull request for changes, fixes or simply a message for any suggestion.

== See

Vivien Didelot vivien.didelot@gmail.com http://github.com/v0n/worldcat

FAQs

Package last updated on 17 Sep 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.