5

Similar to Facebook's UI, I am attempting at generating a preview image from an external linked website. So that when a user types in a url he is linking, the UI will by default, scan that site for an img and scrape a preview thumb.

Is there a specific name for this technique? Or can anyone point me in the direction of learning this?

Thanks so much!

Trip
  • 26,756
  • 46
  • 158
  • 277

2 Answers2

3

Its called scraping. There is a library called scrAPI.

Here is a code example http://crunchlife.com/articles/2007/08/13/code-snippet-ruby-image-scraper

ramn
  • 467
  • 8
  • 12
3

There are a couple different options when it comes to page scraping. Another one to check out would be nokogiri, http://nokogiri.org/. You can find tutorials on how to use it at http://nokogiri.org/tutorials.

Instead of grabbing an image from the site, why not grab the image of the entire page? You could make use of a free screenshot service like http://www.websnapr.com/ or http://www.thumbshots.com/ among others. In one application, I use that for my preview image, and use nokogiri to scrape the page title and description. Just an idea.

Glenn
  • 1,092
  • 1
  • 10
  • 22