Permalink
Browse files

Merge pull request #443 from plytro/googlefix

Correct regex for getting first google link
  • Loading branch information...
2 parents e62704c + 5e6fc66 commit 397323ae26f301e428050d5591ad1a5a02b1aeb1 @tombell tombell committed May 29, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/scripts/google.coffee
@@ -11,5 +11,5 @@ googleMe = (msg, query, cb) ->
msg.http('http://www.google.com/search')
.query(q: query)
.get() (err, res, body) ->
- cb body.match(/<a href="([^"]*)" class=l>/)?[1] || "Sorry, Google had zero results for '#{query}'"
+ cb body.match(/class="r"><a href="\/url\?q=([^"]*)(&amp;sa.*)">/)?[1] || "Sorry, Google had zero results for '#{query}'"

0 comments on commit 397323a

Please sign in to comment.