Skip to content

Instantly share code, notes, and snippets.

@vo
Created January 17, 2011 18:26
Show Gist options
  • Save vo/783202 to your computer and use it in GitHub Desktop.
Save vo/783202 to your computer and use it in GitHub Desktop.
Tiny Script to get Number of Search Results for wu*t
#!/usr/bin/env python
# getting number of search results from google
# by christopher vo
import urllib2, re, time
reg = re.compile('About(.*?)results')
for i in range(1, 20):
wut = 'w' + 'u'*i + 't'
url = 'http://www.google.com/search?q=' + wut
request = urllib2.Request(url)
request.add_header('User-agent', 'Chrome')
search = reg.search(urllib2.urlopen(request).read())
if search:
num = int(search.group(1).replace(',',''))
print i, num, wut
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment