# Path: theHarvester/parsers/intelxparser.py
# class Parser:
#     def __init__(self):
#     async def parse_dictionaries(self, results: dict) -> tuple:


from theHarvester.discovery.constants import *
from theHarvester.lib.core import *
from theHarvester.parsers import intelxparser
import asyncio
import json
import requests
            data = {
                "term": self.word,
                "buckets": [],
                "lookuplevel": 0,
                "maxresults": self.limit,
                "timeout": 5,
                "datefrom": "",
                "dateto": "",
                "sort": 2,
                "media": 0,
                "terminate": [],
                "target": 0
            }

            total_resp = requests.post(f'{self.database}/phonebook/search', headers=headers, json=data)
            phonebook_id = json.loads(total_resp.text)['id']
            await asyncio.sleep(2)

            # Fetch results from phonebook based on ID
            resp = await AsyncFetcher.fetch_all(
                [f'{self.database}/phonebook/search/result?id={phonebook_id}&limit={self.limit}&offset={self.offset}'],
                headers=headers, json=True, proxy=self.proxy)
            resp = resp[0]
            self.results = resp
        except Exception as e:
            print(f'An exception has occurred in Intelx: {e}')

    async def process(self, proxy=False):
        self.proxy = proxy
        await self.do_search()

# Path: theHarvester/parsers/intelxparser.py
# class Parser:
#     def __init__(self):
#     async def parse_dictionaries(self, results: dict) -> tuple:


# Path: theHarvester/discovery/intelxsearch.py
from theHarvester.discovery.constants import *
from theHarvester.lib.core import *
from theHarvester.parsers import intelxparser
import asyncio
import json
import requests

            data = {
                "term": self.word,
                "buckets": [],
                "lookuplevel": 0,
                "maxresults": self.limit,
                "timeout": 5,
                "datefrom": "",
                "dateto": "",
                "sort": 2,
                "media": 0,
                "terminate": [],
                "target": 0
            }

            total_resp = requests.post(f'{self.database}/phonebook/search', headers=headers, json=data)
            phonebook_id = json.loads(total_resp.text)['id']
            await asyncio.sleep(2)

            # Fetch results from phonebook based on ID
            resp = await AsyncFetcher.fetch_all(
                [f'{self.database}/phonebook/search/result?id={phonebook_id}&limit={self.limit}&offset={self.offset}'],
                headers=headers, json=True, proxy=self.proxy)
            resp = resp[0]
            self.results = resp
        except Exception as e:
            print(f'An exception has occurred in Intelx: {e}')

    async def process(self, proxy=False):
        self.proxy = proxy
        await self.do_search()

        intelx_parser = intelxparser.Parser()