pradeepodela commited on
Commit
966adb2
·
1 Parent(s): a5c4421

Upload 4 files

Browse files
Files changed (4) hide show
  1. app.py +19 -0
  2. emailpy.py +75 -0
  3. requirements.txt +3 -0
  4. templates/index.html +111 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, render_template, request
2
+ from emailpy import *
3
+ app = Flask(__name__)
4
+
5
+ @app.route('/')
6
+ def index():
7
+ return render_template('index.html')
8
+ @app.route('/validate', methods=['POST'])
9
+ def validate():
10
+ firstname = request.form['firstname']
11
+ lastname = request.form['lastname']
12
+ domin = request.form['domin']
13
+ email = run(firstname, lastname, domin)
14
+ send = f'The delivarible Email Address of the person is {email}'
15
+ return render_template('index.html', email=send)
16
+
17
+ if __name__ == '__main__':
18
+ app.run(debug=True)
19
+
emailpy.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+
4
+ api_key = "77586ac6-2be2-40ee-acff-99f4244dfaf2"
5
+ flag = False
6
+ def validate(email_address):
7
+ print(email_address)
8
+ response = requests.get(
9
+ "https://isitarealemail.com/api/email/validate",
10
+ params = {'email': email_address},
11
+ headers = {'Authorization': "Bearer " + api_key })
12
+
13
+ status = response.json()['status']
14
+ print(status)
15
+ if status == "valid":
16
+ print(email_address+" : email is valid")
17
+ return False
18
+ elif status == "invalid":
19
+ print(email_address+" : email is invalid")
20
+ return True
21
+ else:
22
+ print(email_address+" : email was unknown")
23
+ return True
24
+
25
+
26
+
27
+ def run(firstname, lastname, domin):
28
+ for i in range(1, 10):
29
+ email = firstname +'@'+ domin
30
+ flag = validate(email)
31
+ if flag == False:
32
+ return email
33
+
34
+ email = firstname + lastname + '@' + domin
35
+ flag = validate(email)
36
+ if flag == False:
37
+ return email
38
+
39
+ email = lastname + firstname + '@' + domin
40
+ flag = validate(email)
41
+ if flag == False:
42
+ return email
43
+
44
+ email = lastname +'@'+ domin
45
+ flag = validate(email)
46
+ if flag == False:
47
+ return email
48
+
49
+
50
+ email = firstname + '.' + lastname + '@' + domin
51
+ flag = validate(email)
52
+ if flag == False:
53
+ return email
54
+
55
+ email = lastname + '.' + firstname + '@' + domin
56
+ flag = validate(email)
57
+ if flag == False:
58
+ return email
59
+ email = firstname + '_' + lastname + '@' + domin
60
+ flag = validate(email)
61
+ if flag == False:
62
+ return email
63
+ email = lastname + '_' + firstname + '@' + domin
64
+ flag = validate(email)
65
+ if flag == False:
66
+ return email
67
+ if i == 11:
68
+ return "No email found"
69
+ if __name__ == '__main__':
70
+
71
+ firstname = 'pradeep12'
72
+ lastname = 'odela'
73
+ domin = 'gmail.com'
74
+ email = run(firstname, lastname, domin)
75
+ print(email+' -----')
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ requests
2
+ flask
3
+ gunicorn==20.0.4
templates/index.html ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="description" content="This is an AI Content Generator Tool Build by Skolo Online">
7
+ <meta name="author" content="Zatosh Nakamoto">
8
+ <title> Email predector </title>
9
+
10
+ <!-- Bootstrap core CSS -->
11
+ <!-- CSS only -->
12
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
13
+
14
+ <!-- Favicons -->
15
+ <link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='images/favicon.png') }}">
16
+
17
+
18
+ <style>
19
+ .bd-placeholder-img {
20
+ font-size: 1.125rem;
21
+ text-anchor: middle;
22
+ -webkit-user-select: none;
23
+ -moz-user-select: none;
24
+ user-select: none;
25
+ }
26
+
27
+ @media (min-width: 768px) {
28
+ .bd-placeholder-img-lg {
29
+ font-size: 3.5rem;
30
+ }
31
+ }
32
+ </style>
33
+
34
+
35
+ <!-- Custom styles for this template -->
36
+ <link href="navbar-top-fixed.css" rel="stylesheet">
37
+ </head>
38
+ <body>
39
+
40
+ <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
41
+ <div class="container-fluid">
42
+ <a class="navbar-brand" style="text-align: center;" href="/">Pradeep's Email predector</a>
43
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
44
+ <span class="navbar-toggler-icon">pradeep</span>
45
+
46
+ </button>
47
+ </div>
48
+ </nav>
49
+
50
+
51
+ <main class="container">
52
+ <div class="bg-light p-5 rounded mt-5">
53
+ <h1> 🐦 Email predector 🐦 ️</h1>
54
+ <p class="lead">
55
+ Want to know email of a person this tool makes your life easier. Just enter the first name , last name and coumpany domine of the person and the tool will give you the actual delivarible email address of the person.
56
+ </p>
57
+
58
+ <h2>Get the email ?</h2>
59
+
60
+ <form class="" action="/validate" method="post">
61
+
62
+ <div class="mb-3">
63
+ <label class="form-label">First Name</label>
64
+ <input required type="text" placeholder="EX: Ankur " class="form-control" name="firstname" >
65
+ <br>
66
+
67
+ <label class="form-label">Last name</label>
68
+ <input required type="text" placeholder="EX: warikoo" class="form-control" name="lastname" >
69
+ <label class="form-label">Domin</label>
70
+ <br>
71
+
72
+ <input required type="text" placeholder="EX: ankurwarikoo.com or gmail.com" class="form-control" name="domin" >
73
+
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <button type="submit" class="btn btn-primary btn-lg"> 💃 Get Email</button>
80
+
81
+ </form>
82
+ </div>
83
+
84
+
85
+ <div class="p-3 rounded">
86
+ <div class="row">
87
+ <div class="col-lg-12">
88
+
89
+ <h3 class="lead">{{email}}</h3>
90
+
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </main>
95
+
96
+
97
+ <!-- JavaScript Bundle with Popper -->
98
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
99
+
100
+
101
+ <footer class="bg-light text-center text-lg-start">
102
+ <!-- Copyright -->
103
+ <div class="text-center p-3" style="background-color: rgba(255, 255, 255, 0.2);">
104
+ © Copyright:
105
+ <a class="text-dark" href="http://pradeepodela.github.io/">Pradeep Odela. </a> All Rights Reserved
106
+ </div>
107
+ <!-- Copyright -->
108
+ </footer>
109
+
110
+ </body>
111
+ </html>