No commit activity in last 3 years
No release in over 3 years
A simple plugin for extracting information from url entered by user (Something like what facebook does). This gem is built on top of opengraph gem created by michael bleigh.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 0
~> 1.5.9
~> 1.6.7
>= 0
 Project Readme

Url Scraper¶ ↑

Its a simple plugin for providing facebook style url scraper. Using url scraper you can convert any simple textarea into a smart textarea which auto detects url entered by users and fetches the content of the webpage and displays it on the page. This gem is built on top of gem 'opengraph' by Michael Bleigh. This gem uses the opengraph tags as well as uses meta, title and img tags (in case if opengraph tags are not present) to fetch information about a page.

Installation¶ ↑

Add to your gemfile

gem "url_scraper"

Paste this line in your application.js file

//= require jquery.scraper

Paste this line in your application.css file

*= require scraper

Add following to your routes

match '/scrape_url' => "UrlScraper#scrape", :via => :post

Using the plugin in a view¶ ↑

Create a text area or text field with id=“scrape_url” and that's it.

Advanced Usage¶ ↑

require 'url_scraper'

movie = UrlScraper.fetch('http://www.rottentomatoes.com/m/1217700-kick_ass/')

movie.title # => 'Kick-Ass'
movie.movie? # => true
movie.image # => 'http://images.rottentomatoes.com/images/movie/custom/00/1217700.jpg'

If you try to fetch Open Graph information for a URL that doesn't have any, the fetch method will return values for title tag and other meta tags specified on the page.

The UrlScraper::Object that is returned is just a Hash with accessors built into it, so you can examine what properties you've retrieved like so:

movie.keys # => ['type','image','title','url']

Pending list¶ ↑

1) Showing video on the page.

2) Giving developers an easy way to integrate with rails forms.