diff --git a/get_random_image.rb b/get_random_image.rb index 8681c8e..c647598 100644 --- a/get_random_image.rb +++ b/get_random_image.rb @@ -10,6 +10,7 @@ def get_random_image(photos) prop: 'imageinfo', titles: "#{random_photo}", # Specify the category title iiprop: 'url|user|extmetadata', + iiurlwidth: 1000, format: 'json' # Request response in JSON format } @@ -25,6 +26,7 @@ def get_random_image(photos) license = info['imageinfo'].first['extmetadata']['LicenseShortName']['value'] license_url = info['imageinfo'].first['extmetadata']['LicenseUrl']['value'] desc = info['imageinfo'].first['extmetadata']['ImageDescription']['value'] + thumb = info['imageinfo'].first['thumburl'] - return {:user => user, :url => url, :license => license, :desc => desc, :license_url => license_url, :user_url => user_url} + return {:user => user, :url => url, :thumb => thumb, :license => license, :desc => desc, :license_url => license_url, :user_url => user_url} end \ No newline at end of file diff --git a/views/index.erb b/views/index.erb index 92403e6..8027669 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,6 +1,6 @@
Description: <%= image[:desc] %>
Photo by: <%= image[:user_url] %>