Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A cross-website product information fetcher for ruby.
tree: 7ad2132a5a

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
test
.document
.gitignore
.travis.yml
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
VERSION
fletcher.gemspec

README.md

Fletcher

Build Status

Fletcher is a cross-website product/model 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, price, images)
  • ThinkGeek (name, description, price, images)
  • Etsy (name, description, price, images)

Installation

gem install fletcher

Usage

require "fletcher"

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

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

model.description # => "A wonderful unicycle"

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

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

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

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

Attributes

The following attributes are available from models:

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