Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bb48f96

Browse files
Create temp_sign_up_tool.py
1 parent b41f277 commit bb48f96

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
from bs4 import BeautifulSoup as soup # HTML data structure
2+
import requests # Web client
3+
import webbrowser
4+
import string
5+
import random
6+
import sys
7+
8+
9+
10+
def generateNames():
11+
12+
# a list with random names to use for username
13+
# we choose a random name from the list
14+
15+
names = "Mario Speedwagon, Petey Cruiser, Anna Sthesia, Molive, Anna Mull, Gail Forcewind, Paige Turner, Bob Frapples, Walter Melon, Nick R. Bocker, Barb Ackue, Buck Kinnear, Greta Life, Ira Membrit, Shonda Leer, Brock Lee, Maya Didas, Rick O'Shea, Monty Carlo, Sal Monella, Sue Vaneer, Cliff Hanger, Barb Dwyer, Terry Aki, Cory Ander, Robin Banks, Jimmy Changa, Barry Wine, Wilma Mumduya, Buster Hyman, Poppa Cherry, Zack Lee, Don Stairs, Saul T. Balls, Peter Pants, Hal Appeno, Otto Matic, Moe Fugga, Graham Cracker, Tom Foolery, Al Dente, Bud Wiser, Polly Tech, Holly Graham, Frank N. Stein, Cam L. Toe, Pat Agonia, Tara Zona, Barry Cade, Phil Anthropist, Marvin Gardens, Phil Harmonic, Arty Ficial, Will Power, Donatella Nobatti, Juan Annatoo, Stew Gots, Anna Rexia, Bill Emia, Curt N. Call, Max Emum, Minnie Mum, Bill Yerds, Hap E. Birthday, Matt Innae, Polly Science, Tara Misu, Ed U. Cation, Gerry Atric, Kerry Oaky, Midge Itz, Gabe Lackmen, Mary Christmas, Dan Druff, Jim Nasium, Angie O. Plasty, Ella Vator, Sal Vidge, Bart Ender, Artie Choke, Hans Olo, Marge Arin, Hugh Briss, Gene Poole, Ty Tanic, Manuel Labor, Lynn Guini, Claire Voyant, Peg Leg, Jack E. Sack, Marty Graw, Ash Wednesday, Olive Yu, Gene Jacket, Tom Atoe, Doug Out, Sharon Needles, Beau Tie, Serj Protector, Marcus Down, Warren Peace, Bud Jet, Barney Cull, Marion Gaze, Eric Shun, Mal Practice, Ed Itorial, Rick Shaw, Paul Issy, Ben Effit, Kat E. Gory, Justin Case, Louie Z. Ana, Aaron Ottix, Ty Ballgame, Anne Fibbiyon, Barry Cuda, John Withawind, Joe Thyme, Mary Goround ,Marge Arita, Frank Senbeans, Bill Dabear, Ray Zindaroof, Adam Zapple, Lewis N. Clark, Matt Schtick, Sue Shee, Chris P. Bacon, Doug Lee Duckling, Mason Protesters, Sil Antro, Cal Orie, Sara Bellum, Al Acart, Marv Ellis, Evan Shlee, Terry Bull, Mort Ission, Mark Ette, Ken Tucky, Louis Ville, Colin Oscopy, Fred Attchini, Al Fredo, Penny Tration, Reed Iculous, Chip Zinsalsa, Matt Uhrafact, Jack Dup, Mike Roscope, Lou Sinclark, Faye Daway, Javy Cad,, Tom Ollie, Sam Buca, Phil Anderer, Sam Owen, Mary Achi, Ray Cyst, Curtis E. Flush, Holland Oats, Helen Highwater, Eddy Kitt, Al Toesacks, Sir Kim Scision, Elle Bowdrop, Yu Tube, Ellis Dee, Anna Lytics, Sara Bellum, Penny Trate, Phil Erup, Jenna Side, Mary Nara, Mick Donalds, Amber Alert, Vic Tory, Bobby Pin, Dom Inate, Hugh Miliation, Christian Mingle, Juan Soponatime, Dante Sinferno, Ed Zupp, Sarah Yevo, Jess Thetip, Arthur Itis, Faye Sbook, Carrie R. Pigeon, Rachel Slurs, Ty Pryder, Cole Slaw, Pat Ernity, Deb Utant, Luke Warm, Travis Tee, Clara Fication, Paul Itician, Deb Utant, Moe Thegrass, Carol Sell, Scott Schtape, Cody Pendant, Frank Furter, Barry Dalive, Mort Adella, Ray Diation, Mack Adamia, Farrah Moan, Theo Retical, Eda Torial, Mae Nayse, Bella Ruse, Yuri thra, Tucker Doubt, Cara Larm, Abel Body, Sal Ami, Colin Derr, Cathy Derr, Colin Scopy, Mel Anoma, Adam Up, Lou Zing, Mark Key, Sven Gineer, Mick Rib, Benny Ficial, Genie Inabottle, Gene Therapy, Reggie Stration, Lou Ow, Lance Dorporal, Lou Tenant, Nick Knack, Patty Whack, Reuben Sandwich, Hugo Slavia, Aaron Spacemuseum, Petey Atricks, Dan Delion, Terry Torial, Cal Q. Later, Jen Trification, Indy Nile, Ray Volver, Minnie Strone, Gustav Wind, Paul Samic, Vinny Gret, , oyce Tick, Cliff Diver, Earl E. Riser, Cooke Edoh, Jen Youfelct, Reanne Carnation, Paul Misunday, Chris P. Cream, Gio Metric, Caire Innet, Marsha Mello, Manny Petty, Val Adictorian, Lucy Tania, Jaques Amole"
16+
names = names.split(", ")
17+
return random.choices(names)[0]
18+
19+
20+
def generatePassword(length):
21+
22+
# declaring [letter (upper and lower case), numbers, and special characters]
23+
letters = string.ascii_letters
24+
numbers = string.digits
25+
punctuations = "!#$%&()*+-/<=>?@[]^_{|}~"
26+
27+
# we convert all the characters from above into a list
28+
# we then shuffle this list to create a random sequence
29+
# and choose a sequence of given length
30+
31+
printable = f'{letters}{numbers}{punctuations}'
32+
printable = list(printable)
33+
random.shuffle(printable)
34+
temp_password = ''.join(random.choices(printable, k=length))
35+
return temp_password
36+
37+
38+
def generateEmailIdAndLink():
39+
40+
# providing header for beautiful soup
41+
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0'}
42+
43+
# using request.get on https://10minutemail.net/ site, and pass header as extra data
44+
response = requests.get('https://10minutemail.net/', headers=headers)
45+
ses = str(response.cookies).split(",")[2].split(" ")[2] # the response has session Id required to retrieve email and link
46+
47+
response = requests.get('https://10minutemail.net/address.api.php?' + ses) # we then pass this session id to get JSON data for the email
48+
page_soup = soup(response.content, "html.parser") # saving the json
49+
50+
51+
# selecting the needed data from the json, cleaning the data
52+
cookies = str(page_soup).split('"')
53+
permalink = cookies[cookies.index("url") + 2] # url for the given email
54+
permalink = permalink.replace('\/', "/") + "?key=" + cookies[cookies.index("key") + 2] # to access the mail page an extra key data is required [mentioned in json object]
55+
56+
temp_email_id = cookies[cookies.index("mail_get_mail") + 2]
57+
return temp_email_id, permalink
58+
59+
60+
def getResult(name, password, email, link):
61+
62+
# Different ways to get the data from the script (different UI methods)
63+
64+
getResultInChromeTab(name, password, email, link) # opens a new tab in chrome with the temporary data
65+
# getResultInNotepad(name, password, email, link) # open a new notepad with the temporary data
66+
# getResultInClipboard(name, password, email, link) # stores data in clipboard (multiple clipboard items) [--coming soon--]
67+
68+
# add a if else case if you want to choose options during run time
69+
70+
71+
def getResultInChromeTab(name, password, email, link):
72+
73+
# creates a file with html extension
74+
# writes out the data in the file (using basic html format [paras and href]) [-- can be beautified --]
75+
# saves the data and opens the file (open in localhost)
76+
77+
out_filename = "tempRegistration.html"
78+
f = open(out_filename, "w")
79+
80+
f.write('<p> Username: ' + name + "</p>")
81+
f.write('<p> Password: ' + password + "</p>")
82+
f.write('<p> Email Id: ' + email + "</p>")
83+
f.write('<a href = "url"> Link: ' + link + "</a>")
84+
f.close()
85+
webbrowser.open("tempRegistration.html")
86+
87+
88+
def getResultInNotepad(name, password, email, link):
89+
90+
# creates a file with txt extension
91+
# writes all the data in the file saves it closes it and then opens it as a popup
92+
93+
out_filename = "tempRegistration.txt"
94+
f = open(out_filename, "w")
95+
96+
f.write('Name: ' + name + '\n')
97+
f.write("Password: " + password + '\n')
98+
f.write("Email Id: " + email + '\n' + '\n')
99+
f.write("Link: " + link)
100+
101+
f.close()
102+
webbrowser.open("tempRegistration.txt")
103+
104+
105+
if __name__ == "__main__":
106+
107+
# function call to generate a password
108+
# inputs given to the functions is length of the password
109+
random_password = generatePassword(16)
110+
111+
# function call for creating a list with random names and returning a temporary username
112+
random_name = generateNames()
113+
114+
# function call to get temporary email with its link to get confirmation mails etc
115+
temporary_emailID, temp_link = generateEmailIdAndLink()
116+
117+
# multiple ways to get output in UI
118+
getResult(random_name, random_password, temporary_emailID, temp_link)
119+
120+
# get result as a new text file
121+
# get result as a new chrome tab
122+
# get result in clipboard win + V change settings if not enables

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /