class UrlExpander::Expanders::Qsrli

Expand Qsrli URLS Usage: UrlExpander::Client.expand(“qsr.li/5Zg9”)

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/qsrli.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 Qsr.li html document

# File lib/url_expander/expanders/scrape/qsrli.rb, line 19
def self.scrape_url(html)
  doc = Hpricot(html)
  doc.at('//*[@id="framecontent"]').attributes["src"]
end