Class: Onebox::Engine::HackernewsOnebox
- Inherits:
-
Object
- Object
- Onebox::Engine::HackernewsOnebox
- Includes:
- Onebox::Engine, JSON, LayoutSupport
- Defined in:
- lib/onebox/engine/hackernews_onebox.rb
Constant Summary collapse
- REGEX =
%r{^https?://news\.ycombinator\.com/item\?id=(?<item_id>\d+)}
Instance Attribute Summary
Attributes included from Onebox::Engine
#errors, #options, #timeout, #uri
Instance Method Summary collapse
-
#url ⇒ Object
This is their official API: blog.ycombinator.com/hacker-news-api/.
Methods included from LayoutSupport
Methods included from Onebox::Engine
all_iframe_origins, engines, included, #initialize, origins_to_regexes, #placeholder_html, #to_html
Instance Method Details
#url ⇒ Object
This is their official API: blog.ycombinator.com/hacker-news-api/
15 16 17 |
# File 'lib/onebox/engine/hackernews_onebox.rb', line 15 def url "https://hacker-news.firebaseio.com/v0/item/#{match[:item_id]}.json" end |