async def get_people(self, proxy=False): self.proxy = proxy rawres = myparser.Parser(self.totalresults, self.word) to_parse = await rawres.people_twitter() # fix invalid handles that look like @user other_output handles = set() for handle in to_parse: result = re.search(r'^@?(\w){1,15}', handle) if result: handles.add(result.group(0)) return handles
async def get_urls(self): try: rawres = myparser.Parser(self.totalresults, 'trello.com') self.trello_urls = set(await rawres.urls()) self.totalresults = '' # reset what totalresults as before it was just google results now it is trello results headers = { 'User-Agent': random.choice(['curl/7.37.0', 'Wget/1.19.4']) } # do not change the headers responses = await AsyncFetcher.fetch_all(self.trello_urls, headers=headers, proxy=self.proxy) for response in responses: self.totalresults += response rawres = myparser.Parser(self.totalresults, self.word) self.hostnames = await rawres.hostnames() except Exception as e: print(f'Error occurred: {e}')
async def get_emails(self): rawres = myparser.Parser(self.total_results, self.word) toparse_emails = await rawres.emails() emails = set() # strip out numbers and dashes for emails that look like [email protected] for email in toparse_emails: email = str(email) if '-' in email and email[0].isdigit() and email.index('-') <= 9: while email[0] == '-' or email[0].isdigit(): email = email[1:] emails.add(email) return list(emails)
async def get_hostnames(self): rawres = myparser.Parser(self.results, self.word) new_lst = [] for host in await rawres.hostnames(): host = str(host) if host[0].isdigit(): matches = re.match('.+([0-9])[^0-9]*$', host) # Get last digit of string and shift hostname to remove ip in string new_lst.append(host[matches.start(1) + 1:]) else: new_lst.append(host) return new_lst
async def get_hostnames(self) -> list: parser = myparser.Parser(self.total_results, self.word) return await parser.hostnames()
async def get_emails(self) -> set: parser = myparser.Parser(self.total_results, self.word) return await parser.emails()
async def get_hostnames(self): rawres = myparser.Parser(self.totalresults, self.word) return await rawres.hostnames()
async def get_emails(self): rawres = myparser.Parser(self.totalresults, self.word) return await rawres.emails()
async def get_profiles(self): rawres = myparser.Parser(self.total_results, self.word) return await rawres.profiles()
async def get_links(self): links = myparser.Parser(self.totalresults, self.word) return await splitter(await links.links_linkedin())
async def get_people(self): rawres = myparser.Parser(self.totalresults, self.word) temp = await rawres.people_linkedin() return [person for person in temp if person[0] != '.' and '...' not in person and len(person.split()) != 1]
async def get_hostnames(self, proxy=False): self.proxy = proxy rawres = myparser.Parser(self.total_results, self.word) return await rawres.hostnames()
async def get_files(self): rawres = myparser.Parser(self.totalresults, self.word) return rawres.fileurls(self.files)