Skip to content
This repository

A cross-website product information fetcher for ruby.

tree: 35f7cf691f

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 fletcher.gemspec
README.md

Fletcher

Build Status

Fletcher is a cross-website product/item information fetcher. Give fletcher a product url and you'll get back a nice, simple object that's easy to work with.

Features

  • Uses nokogiri for data parsing
  • No third-party API Access Required (Good for websites that don't even have API access)

Supported Websites

  • Amazon (name, description, price, images)
  • eBay (name, images)
  • ThinkGeek (name, description, images)
  • Etsy (name, description, images)

Installation

gem install fletcher

Examples

require "fletcher"

item = Fletcher.fetch # => "http://www.amazon.com/Avenir-Deluxe-Unicycle-20-Inch-Wheel/dp/B00165Q9F8"

item.name # => "Avenir Deluxe Unicycle (20-Inch Wheel)"

item.description # => "A wonderful unicycle"

item.image # => {:url => "http://ecx.images-amazon.com/images/I/41b3TNb3uCL._SL500_AA300_.jpg", :alt => "Picture of Unicycle"}

item.image.url # => "http://ecx.images-amazon.com/images/I/41b3TNb3uCL._SL500_AA300_.jpg"

item.price # => #<Money cents:500 currency:USD>
item.price.to_f # => 5.0
item.price.format # => "$5.00"  
item.price.currency.symbol # => "$"

# Get Raw Nokogiri Document
item.doc.class.name # => Nokogiri::HTML::Document

Attributes

The following attributes are available from items:

  • title - (String) The name of the item/product
  • description - (String) The item/product description
  • price - (Money) A Money object representing the item price. This makes exchange rates and math functionality easy to use.
  • image - (Hash) The main image of the item
  • images - (Array) Any available images of the item
Something went wrong with that request. Please try again.