Giter Site home page Giter Site logo

allan-farrell / worldcatapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from taras-yorku/worldcatapi

0.0 1.0 0.0 240 KB

The RUBY API to access WorldCat.org webservices. Inspired by original wcapi implementation

License: MIT License

Ruby 100.00%

worldcatapi's Introduction

worldcatapi

The RUBY API to access WorldCat.org webservices. Inspired by original wcapi implementation

Worldcatapi

Forked from RubyForge WCAPI project. It now lives on rubygems.org for easy installation and usage.

Installation

Add this line to your application's Gemfile:

gem 'worldcatapi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install worldcatapi

NOTE on Nokogiri and Rails:

worldcatapi 1.0.3 requires nokogiri versions 1.5.x, usable for Rails 4.1 or older worldcatapi 1.0.4 requires nokogiri versions 1.6.x, usable for Rails 4.2 or newer

Usage

Clone this project and look at example.rb file.

It outlines all of the available operations.

require 'worldcatapi'

client = WORLDCATAPI::Client.new key: YOUR_KEY
response = client.OpenSearch(q: 'Ruby Development', format: 'atom', start: 1, count: 20, cformat: "all")

puts "Total Results #{response.header["totalResults"]
response.records.each do |record|
    puts "title: #{record[:title]}\n"
    puts "url: #{record[:link]}\n"
    puts "authors: #{record[:author].join(", "}\n"
    puts "description: #{record[:summary]}\n"
end

More examples available in example.rb

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.