forked from faniAhmed/FacebookAdsLibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (19 loc) · 749 Bytes
/
Copy pathtest.py
File metadata and controls
27 lines (19 loc) · 749 Bytes
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
from AdsLibrary.main import FacebookAdsLibrary
if __name__ == '__main__':
fb = FacebookAdsLibrary()
page_id = fb.get_company_id('noticaribe peninsular')
print(f'Internal Facebook ID of the page (company ID) is {page_id}')
ads = fb.get_ads(str(int(page_id))).get('Ads')
emails = set()
phones = set()
websites = set()
for a in ads:
if a["Email"]:
emails.add(a["Email"])
if a["Phone"]:
phones.add(a["Phone"])
if a["Website"]:
websites.add(a["Website"])
print(f'Unique email adressses of ads are: {", ".join(emails)}')
print(f'Unique phone numbers of ads are: {", ".join(phones)}')
print(f'Unique websites of ads are: {", ".join(websites)}')