lib/onebox/engine/wikimedia_onebox.rb in onebox-1.8.68 vs lib/onebox/engine/wikimedia_onebox.rb in onebox-1.8.69

- old
+ new

@@ -20,23 +20,23 @@ "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 private - def match - @match ||= @url.match(/^https?:\/\/commons\.wikimedia\.org\/wiki\/(?<name>File:.+)/) - end + def match + @match ||= @url.match(/^https?:\/\/commons\.wikimedia\.org\/wiki\/(?<name>File:.+)/) + end - def data - first_page = raw['query']['pages'].first[1] + def data + first_page = raw['query']['pages'].first[1] - { - link: first_page['imageinfo'].first['descriptionurl'], - title: first_page['title'], - image: first_page['imageinfo'].first['url'], - thumbnail: first_page['imageinfo'].first['thumburl'] - } - end + { + link: first_page['imageinfo'].first['descriptionurl'], + title: first_page['title'], + image: first_page['imageinfo'].first['url'], + thumbnail: first_page['imageinfo'].first['thumburl'] + } + end end end end