Class: Onebox::Engine::WikimediaOnebox
- Inherits:
-
Object
- Object
- Onebox::Engine::WikimediaOnebox
- Includes:
- Onebox::Engine, JSON, LayoutSupport
- Defined in:
- lib/onebox/engine/wikimedia_onebox.rb
Constant Summary
Constants included from Onebox::Engine
Instance Attribute Summary
Attributes included from Onebox::Engine
#errors, #options, #timeout, #uri
Class Method Summary collapse
Instance Method Summary collapse
Methods included from LayoutSupport
Methods included from Onebox::Engine
all_iframe_origins, engines, included, #initialize, origins_to_regexes, #placeholder_html, #to_html
Class Method Details
.priority ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/onebox/engine/wikimedia_onebox.rb', line 13 def self.priority # Wikimedia links end in an image extension. # E.g. https://commons.wikimedia.org/wiki/File:Stones_members_montage2.jpg # This engine should have priority over the generic ImageOnebox. 1 end |
Instance Method Details
#url ⇒ Object
21 22 23 |
# File 'lib/onebox/engine/wikimedia_onebox.rb', line 21 def url "https://en.wikipedia.org/w/api.php?action=query&titles=#{match[:name]}&prop=imageinfo&iilimit=50&iiprop=timestamp|user|url&iiurlwidth=500&format=json" end |