Last active
August 29, 2015 14:00
-
-
Save philihp/11333192 to your computer and use it in GitHub Desktop.
Queries Google Voice's web service for all possible phone numbers
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
#!/usr/bin/python | |
import sys | |
import urllib2 | |
import json | |
opener = urllib2.build_opener() | |
opener.addheaders.append(('Cookie', ...put your browser session cookies here... )) | |
for n in xrange(2000,9999): | |
npad = "{0:04d}".format(n) | |
#print "Searching", npad | |
f = opener.open('https://www.google.com/voice/setup/search/?ac='+npad+'&start=0&country=US') | |
data =json.loads(f.read()) | |
f.close() | |
num = data.get('JSON').get('num_matches') | |
for x in xrange(0,int(num),5): | |
f = opener.open('https://www.google.com/voice/setup/search/?ac='+npad+'&start='+str(x)+'&country=US') | |
data = json.loads(f.read()) | |
f.close() | |
numbers = data.get('JSON').get('vanity_info').keys() | |
for number in numbers: | |
number = number[2:] | |
#if number == number[::-1]: | |
# print number | |
print number | |
sys.stdout.flush() | |
if len(numbers)!=5: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment