| December 20, 2011 by |
We recently created a new ruby gem called fletcher. It's a cross- website product/item information fetcher. To use fletcher, all you have to do it pass it a url to a product on one of favorite websites. You'll get back an easy-to-use ActiveRecord-like object(a Hashie::Mash) that contains useful information about that product, including its name, description, images, etc. Let's see it in action.
item = Fletcher.fetch
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"
We originally wrote fletcher for use in our wishlist-sharing website, WishlistFactory, so you would only need to enter the url of a gift you want, and the gift information would automatically be fetched and included on your wishlist. We thought other people might find this useful, so we packaged it up as a gem and released it to the public.
The source code of fletcher is also on github, so if you'd like to add a supported website to fletcher, or make any other changes, feel free to fork it!
