-
Notifications
You must be signed in to change notification settings - Fork 0
/
emailverify.py
62 lines (44 loc) · 1.63 KB
/
emailverify.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/python
# _*_ coding:utf-8 _*_
import requests
import datetime
class EmailListVerifyOne():
def __init__(self, key, email):
self.key = key
self.email = email
self.verif = "https://apps.emaillistverify.com/api/verifEmail?secret="
self.url = self.verif+self.key+"&email="+self.email
def control(self):
r = requests.get(self.url)
return r.text
class EmailListVerifyBulk():
def __init__(self, key, user_file):
datenow = datetime.datetime.now()
self.key = key
self.name = 'File' + datenow.strftime("%Y-%m-%d %H:%M")
self.user_file = user_file
self.url = 'https://apps.emaillistverify.com/api/verifApiFile?secret='+key+'&filename=%s' % self.name
def upload(self):
import pycurl
infile = open('id_file', 'w')
c = pycurl.Curl()
c.setopt(c.POST, 1)
c.setopt(c.URL, self.url)
c.setopt(c.HTTPPOST, [('file_contents', (
c.FORM_FILE, self.user_file,
c.FORM_CONTENTTYPE, 'text/plain',
c.FORM_FILENAME, self.name.replace(' ','_'),)),])
c.setopt(c.WRITEFUNCTION, infile.write)
c.setopt(c.VERBOSE, 1)
c.perform()
c.close()
def get_info(self):
with open('id_file','r') as f:
ids = f.read()
url = 'https://apps.emaillistverify.com/api/getApiFileInfo?secret='+self.key+'&id=%s' % ids
r = requests.get(url)
with open('result.txt', 'a') as res:
res.write(r.content+'\n')
print(r.content)
if __name__ == '__main__':
pass