Pages

2009-08-16

A list of all numbers on Google Voice

Update 2013-10-03: If you just want a good number in your area code and don't want to spend 1-2 days setting up Unix, mail me at phonenumbers@phor.net. I ask $30 for this service in BTC or Paypal 

Update 2011-01-27: thanks to A. Manessi for bug reports
Update 2010-07-09: thanks to Michael Poon at MIT for showing how to login via curl

1. Login to Google Voice with Firefox / LiveHTTPHeaders

Don't use Chrome. I know, I know... just download Firefox.

2. Find which area codes Google Voice has

mkdir GOOGLEVOICE; cd GOOGLEVOICE

# open https://www.google.com/voice/b/0/setup/searchnew/?ac=484&start=0
# use LiveHTTPHeaders and get the cookies
URL="https://www.google.com/voice/b/0/setup/searchnew/"
COOKIES="gv=DQAAAxxxxxx; PREF=xxxxx; xxxx SSID=xxxx" # PUT YOUR COOKIES IN HERE
curl --cookie "$COOKIES" "${URL}?ac=[201-999]&start=0" | grep -ho "+1[0-9]\{3\}" | cut -b3-5 | sort -u >> areacodes

# area codes available as of 2012-09-22
# 201 202 203 205 206 207 208 209 210 213 214 215 216 217 218 219 224 225 228
# 229 231 234 239 240 248 251 252 253 254 256 260 262 267 269 270 276 281 301
# 302 303 304 305 307 309 310 312 313 314 315 316 317 318 319 320 321 323 325
# 330 331 334 336 337 339 347 352 360 361 385 386 401 402 403 404 405 406 407
# 408 409 410 412 413 414 415 417 419 423 424 425 430 432 434 435 440 442 443
# 458 469 470 478 479 480 484 501 502 503 504 505 507 508 509 510 512 513 515
# 516 517 518 520 530 539 540 541 551 559 561 562 563 567 570 571 573 574 575
# 580 585 586 601 602 603 605 606 607 608 609 610 612 614 615 616 617 618 619
# 620 623 626 630 631 636 646 650 651 657 660 661 662 678 681 682 701 702 703
# 704 706 707 708 713 714 715 716 717 718 719 720 724 727 731 732 734 740 747
# 754 757 760 762 763 765 769 770 772 773 774 775 779 781 785 786 801 802 803
# 804 805 806 810 812 813 814 815 816 817 818 828 830 831 832 843 845 847 848
# 850 856 857 858 859 860 862 863 864 865 870 872 901 903 904 906 908 909 910
# 912 913 914 915 916 917 918 919 920 925 928 931 936 937 940 941 947 949 951
# 952 954 956 970 971 972 973 978 979 980 985 989

3. Get numbers in your target area codes

# add a full number from each area code you want to NUMBERS printf "4840000000\n8480000000\n" > numbers # BFS on each digit to find all numbers, about 30 minutes per area code cut -b1-3 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers cut -b1-4 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers cut -b1-5 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers cut -b1-6 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers cut -b1-7 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers cut -b1-8 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers cut -b1-8 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=5"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers

4. Harvest out your winnings 

sort -u numbers > sorted; mv sorted numbers

5. Find cool numbers, using my definition of cool

# repeated set of 4 digits
grep -P "(\d{4}).*\1" numbers
# 4843248432

# the whole number, with a limited number of unique digits
grep -P "^(\d)\1*(\d)\1*\2*\1*\2*\1*\2*\1*\2*(\d)(\1|\2|\3)*$" numbers
grep -P "^...(\d)\1*(\d)(\1|\2)*$" numbers
# 7722020227

# triple double
grep -P "(\d)\1.*(\d)\2.*(\d)\3" numbers
# 4842220022
# 4842220044

# triples
grep -P "(\d)\1\1.*(\d)\2\2" numbers
grep -P '(\d)\1{2,}' numbers
# 4849388886
# 4842220002

# palindrome
grep -P "(\d)(\d)(\d)(\d)(\d)\5?\4\3\2\1" numbers
grep -P "(\d)(\d)(\d)(\d)\4?\3\2\1" numbers
# 4846399364
# 4842020248

# toggles
grep -P "(\d)(\d)\1\2\1" numbers
grep -P "(\d)(\d)\1\2\1\2" numbers
# 4848421212

# use two digits
grep -P "(\d)(\d)(\1|\2){4}" numbers
# 4842020002
# 4842020020
# 4842020022
# 4842020220