# Path: theHarvester/parsers/myparser.py
# class Parser:
#     def __init__(self, results, word):
#     async def genericClean(self):
#     async def urlClean(self):
#     async def emails(self):
#     async def fileurls(self, file):
#     async def hostnames(self):
#     async def people_googleplus(self):
#     async def hostnames_all(self):
#     async def links_linkedin(self):
#     async def people_linkedin(self):
#     async def people_twitter(self):
#     async def profiles(self):
#     async def set(self):
#     async def urls(self):
#     async def unique(self) -> list:


from theHarvester.discovery.constants import *
from theHarvester.lib.core import *
from theHarvester.parsers import myparser
from typing import List, Dict, Any, Optional, NamedTuple, Tuple
import asyncio
import aiohttp
import urllib.parse as urlparse
import random

    async def process(self, proxy=False):
        self.proxy = proxy
        try:
            while self.counter <= self.limit and self.page is not None:
                api_response = await self.do_search(self.page)
                result = await self.handle_response(api_response)
                if isinstance(result, SuccessResult):
                    print(f'\tSearching {self.counter} results.')
                    for fragment in result.fragments:
                        self.total_results += fragment
                        self.counter = self.counter + 1
                    self.page = await self.next_page_or_end(result)
                    await asyncio.sleep(get_delay())
                elif isinstance(result, RetryResult):
                    sleepy_time = get_delay() + result.time
                    print(f'\tRetrying page in {sleepy_time} seconds...')
                    await asyncio.sleep(sleepy_time)
                elif isinstance(result, ErrorResult):
                    raise Exception(f"\tException occurred: status_code: {result.status_code} reason: {result.body}")
                else:
                    raise Exception("\tUnknown exception occurred")
        except Exception as e:
            print(f'An exception has occurred: {e}')

    async def get_emails(self):
        rawres = myparser.Parser(self.total_results, self.word)
        return await rawres.emails()

    async def get_hostnames(self):

# Path: theHarvester/parsers/myparser.py
# class Parser:
#     def __init__(self, results, word):
#     async def genericClean(self):
#     async def urlClean(self):
#     async def emails(self):
#     async def fileurls(self, file):
#     async def hostnames(self):
#     async def people_googleplus(self):
#     async def hostnames_all(self):
#     async def links_linkedin(self):
#     async def people_linkedin(self):
#     async def people_twitter(self):
#     async def profiles(self):
#     async def set(self):
#     async def urls(self):
#     async def unique(self) -> list:


# Path: theHarvester/discovery/githubcode.py
from theHarvester.discovery.constants import *
from theHarvester.lib.core import *
from theHarvester.parsers import myparser
from typing import List, Dict, Any, Optional, NamedTuple, Tuple
import asyncio
import aiohttp
import urllib.parse as urlparse
import random


    async def process(self, proxy=False):
        self.proxy = proxy
        try:
            while self.counter <= self.limit and self.page is not None:
                api_response = await self.do_search(self.page)
                result = await self.handle_response(api_response)
                if isinstance(result, SuccessResult):
                    print(f'\tSearching {self.counter} results.')
                    for fragment in result.fragments:
                        self.total_results += fragment
                        self.counter = self.counter + 1
                    self.page = await self.next_page_or_end(result)
                    await asyncio.sleep(get_delay())
                elif isinstance(result, RetryResult):
                    sleepy_time = get_delay() + result.time
                    print(f'\tRetrying page in {sleepy_time} seconds...')
                    await asyncio.sleep(sleepy_time)
                elif isinstance(result, ErrorResult):
                    raise Exception(f"\tException occurred: status_code: {result.status_code} reason: {result.body}")
                else:
                    raise Exception("\tUnknown exception occurred")
        except Exception as e:
            print(f'An exception has occurred: {e}')

    async def get_emails(self):
        rawres = myparser.Parser(self.total_results, self.word)
        return await rawres.emails()

    async def get_hostnames(self):

        rawres = myparser.Parser(self.total_results, self.word)