Skip to content

Instantly share code, notes, and snippets.

@judy2k
Created January 23, 2019 16:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judy2k/eb9901d9084c5268d463c2f9fab98f5d to your computer and use it in GitHub Desktop.
Save judy2k/eb9901d9084c5268d463c2f9fab98f5d to your computer and use it in GitHub Desktop.
Phony! Fake phone number generator.
#!/usr/bin/env python3
import argparse
from random import randint, choice
def uk():
return randint(447700900000, 447700900999+1)
def us_area_code():
return choice([201, 202, 203, 205, 206, 207, 208, 209, 210, 212, 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, 308, 309, 310, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 323, 325, 330, 331, 334, 336, 337, 339, 347, 351, 352, 360, 361, 386, 401, 402, 404, 405, 406, 407, 408, 409, 410, 412, 413, 414, 415, 417, 419, 423, 424, 425, 430, 432, 434, 435, 440, 443, 469, 478, 479, 480, 484, 501, 502, 503, 504, 505, 507, 508, 509, 510, 512, 513, 515, 516, 517, 518, 520, 530, 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, 641, 646, 650, 651, 660, 661, 662, 678, 682, 701, 702, 703, 704, 706, 707, 708, 712, 713, 714, 715, 716, 717, 718, 719, 720, 724, 727, 731, 732, 734, 740, 754, 757, 760, 762, 763, 765, 769, 770, 772, 773, 774, 775, 781, 785, 786, 801, 802, 803, 804, 805, 806, 808, 810, 812, 813, 814, 815, 816, 817, 818, 828, 830, 831, 832, 840, 843, 845, 847, 848, 850, 856, 857, 858, 859, 860, 862, 863, 864, 865, 870, 878, 901, 903, 904, 906, 907, 908, 909, 910, 912, 913, 914, 915, 916, 917, 918, 919, 920, 925, 928, 931, 936, 937, 941, 947, 949, 951, 952, 954, 956, 970, 971, 972, 973, 978, 979, 980, 985, 989])
def us():
return ''.join(['1', str(us_area_code()), str(randint(5550100, 5550199+1))])
def main():
ap = argparse.ArgumentParser()
ap.add_argument('-n', action='store_true', help="Do not print a line-end after the number. Useful for copy-pasting.")
ap.add_argument('country', default='uk', choices=['uk', 'us'], nargs='?')
args = ap.parse_args()
print(globals()[args.country](), end='' if args.n else '\n')
if __name__ == "__main__":
main()
$ phony --help
usage: phony [-h] [-n] [{uk,us}]
positional arguments:
{uk,us}
optional arguments:
-h, --help show this help message and exit
-n Do not print a line-end after the number. Useful for copy-
pasting.
$ phony
447700900356
$ phony us
17605550136
$ phony uk
447700900848
$ phony -n us
19375550159$
@mrjuice01
Copy link

Guys I dont understand how this work can you send clear termux comands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment