Sha256: 8dee2a08c89865e5ed62f446e630f0b7f559a1ab914131ca86ecf54335246522

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

# Fletcher
[![Build Status](http://travis-ci.org/hulihanapplications/fletcher.png)](http://travis-ci.org/hulihanapplications/fletcher)
 

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](http://www.amazon.com) (name, description, price, images)
* [eBay](http://www.ebay.com) (name, price, images)
* [ThinkGeek](http://www.thinkgeek.com) (name, description, price, images)
* [Etsy](http://www.etsy.com) (name, description, price, images)

## Installation

```bash
gem install fletcher
```

## Usage

```ruby
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](https://github.com/RubyMoney/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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fletcher-0.4.0 README.md