Permalink
Browse files

was using gsub!() on data which was being written to the filesystem

  • Loading branch information...
stevenwilkin committed Aug 24, 2009
1 parent b5f8a15 commit 2157e0344a1dd7a4788e53fdf6a6f5085c77be25
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/get_trends.rb
View
@@ -12,8 +12,8 @@
# peforms a google image search for `q` and returns the url of the first image returned
def image_search(q)
- q.gsub!(/[\W]/, '+')
- open(SEARCH + q) do |f|
+ term = q.gsub(/[\W]/, '+')
+ open(SEARCH + term) do |f|
return nil unless f.status[0] == '200'
h = Hpricot(f.read)
h.at('#ImgCont//img')['src']

0 comments on commit 2157e03

Please sign in to comment.