-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
23 lines (16 loc) · 853 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Main file to get data."""
from data_storage import ClientDataStore
from hunter_client.endpoints import EndpointFactory
factory = EndpointFactory('e93c41dd45281f55bbb854ec1e86719c50b90d5d')
domain_search = factory.get_endpoint('domain-search')
email_finder = factory.get_endpoint('email-finder')
email_verifier = factory.get_endpoint('email-verifier')
data_storage = ClientDataStore()
# to get data from hunter.io
emails_by_domain = domain_search.execute('GET', 'stripe.com')
email_by_domain_first_last_name = email_finder.execute('GET', 'reddit.com', 'Alexis', 'Ohanian')
email_verified = email_verifier.execute('GET', '[email protected]')
# to add data to storage and update data
data_storage.add_emails(emails_by_domain)
data_storage.add_emails(email_by_domain_first_last_name)
data_storage.update_email('[email protected]', email_verified)