Skip to content

Instantly share code, notes, and snippets.

@rochefort
Created September 16, 2014 15:27
Show Gist options
  • Save rochefort/afd52dd1cca1a7dd0702 to your computer and use it in GitHub Desktop.
Save rochefort/afd52dd1cca1a7dd0702 to your computer and use it in GitHub Desktop.
5-6-1 P.286
diff --git a/chapter5/flickr-nokogiri.rb b/chapter5/flickr-nokogiri.rb
index bfa87cb..da46acc 100644
--- a/chapter5/flickr-nokogiri.rb
+++ b/chapter5/flickr-nokogiri.rb
@@ -14,7 +14,7 @@ def save_image(url)
end
search_word=URI.encode("cat")
-doc = Nokogiri::HTML(open("https://www.flickr.com/search/?q=#{search_word}"))
+doc = Nokogiri::HTML(open("https://www.flickr.com/search/?text=#{search_word}"))
doc.xpath("//a[@class='rapidnofollow photo-click']/img")
.each {|link|
@@ -29,4 +29,4 @@ doc.xpath("//a[@class='rapidnofollow photo-click']/img")
url = url.gsub('.jpg','_b.jpg')
puts url
save_image(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment