Skip to content

Commit

Permalink
was using gsub!() on data which was being written to the filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenwilkin committed Aug 24, 2009
1 parent b5f8a15 commit 2157e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/get_trends.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@


# peforms a google image search for `q` and returns the url of the first image returned # peforms a google image search for `q` and returns the url of the first image returned
def image_search(q) def image_search(q)
q.gsub!(/[\W]/, '+') term = q.gsub(/[\W]/, '+')
open(SEARCH + q) do |f| open(SEARCH + term) do |f|
return nil unless f.status[0] == '200' return nil unless f.status[0] == '200'
h = Hpricot(f.read) h = Hpricot(f.read)
h.at('#ImgCont//img')['src'] h.at('#ImgCont//img')['src']
Expand Down

0 comments on commit 2157e03

Please sign in to comment.