Created
January 7, 2010 09:15
-
-
Save ptarjan/271101 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will search google voice to see if there are any numbers | |
# available that spell a 10 letter word | |
# | |
# It can easily be customized for 9 letters, or to use your own dictionary, etc. | |
# | |
# Author: Paul Tarjan <http://paulisageek.com> | |
# | |
# Make sure you put your own cookie here. Search the web if you don't know how to find it. | |
cookie = "DQAAA<rest of cookie>" | |
import urllib2 | |
import re | |
def check(c) : | |
global cookie | |
r = urllib2.Request("https://www.google.com/voice/setup/search/?q=" + c, headers={"Cookie" : "gv=" + cookie}) | |
response = urllib2.urlopen(r) | |
data = response.read() | |
if '"Sign in"' in data: | |
print "Bad cookie (probably)" | |
return False | |
if data.find('"num_matches":"0"') != -1 : | |
return False | |
return True | |
def dict(f="/usr/share/dict/words") : | |
for word in file(f).read().split() : | |
if len(word) == 10 and re.match("^[a-zA-Z0-9]+$", word) : | |
if check(word) : | |
print word | |
if "<rest of cookie>" in cookie: | |
print "Please look up your google cookie and put it at the top of this file before running" | |
else: | |
dict() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment