Class: UrlExpander::Expanders::Qsrli
- Defined in:
- lib/url_expander/expanders/scrape/qsrli.rb
Overview
Expand Qsrli URLS Usage: UrlExpander::Client.expand(“qsr.li/5Zg9”)
Defined Under Namespace
Classes: Request
Constant Summary collapse
- PATTERN =
%r'(http://qsr\.li(/[\w/]+))'
Instance Attribute Summary collapse
-
#parent_klass ⇒ Object
readonly
Returns the value of attribute parent_klass.
-
#xpath ⇒ Object
readonly
Returns the value of attribute xpath.
Attributes inherited from Scrape
Class Method Summary collapse
-
.scrape_url(html) ⇒ Object
How to scarpe the url from a Qsr.li html document.
Instance Method Summary collapse
-
#initialize(short_url = "", options = {}) ⇒ Qsrli
constructor
A new instance of Qsrli.
Constructor Details
#initialize(short_url = "", options = {}) ⇒ Qsrli
Returns a new instance of Qsrli.
12 13 14 15 |
# File 'lib/url_expander/expanders/scrape/qsrli.rb', line 12 def initialize(short_url="", ={}) @parent_klass = self.class super(short_url, ) end |
Instance Attribute Details
#parent_klass ⇒ Object (readonly)
Returns the value of attribute parent_klass.
10 11 12 |
# File 'lib/url_expander/expanders/scrape/qsrli.rb', line 10 def parent_klass @parent_klass end |
#xpath ⇒ Object (readonly)
Returns the value of attribute xpath.
10 11 12 |
# File 'lib/url_expander/expanders/scrape/qsrli.rb', line 10 def xpath @xpath end |
Class Method Details
.scrape_url(html) ⇒ Object
How to scarpe the url from a Qsr.li html document
19 20 21 22 |
# 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 |