class UrlExpander::Expanders::Shorl
Expand shorl.com URLS Usage: UrlExpander::Client.expand
(“shorl.com/nigekohalenu”)
Constants
- PATTERN
Attributes
parent_klass[R]
xpath[R]
Public Class Methods
new(short_url="", options={})
click to toggle source
Calls superclass method
UrlExpander::Expanders::Scrape::new
# File lib/url_expander/expanders/scrape/shorl.rb, line 12 def initialize(short_url="", options={}) @parent_klass = self.class super(short_url, options) end
scrape_url(html)
click to toggle source
How to scarpe the url from a shorl html document
# File lib/url_expander/expanders/scrape/shorl.rb, line 19 def self.scrape_url(html) doc = Hpricot(html) doc.at('/html/body/div[3]/p/a').attributes["href"] end