# 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
import json


class SearchDuckDuckGo:

    def __init__(self, word, limit):
        self.word = word
        self.results = ""
        self.totalresults = ""
        self.dorks = []
        self.links = []
        self.database = 'https://duckduckgo.com/?q='
        self.api = 'https://api.duckduckgo.com/?q=x&format=json&pretty=1'  # Currently using API.
        self.quantity = '100'
        self.limit = limit
        self.proxy = False

    async def do_search(self):
        # Do normal scraping.
        url = self.api.replace('x', self.word)
        headers = {'User-Agent': googleUA}
        first_resp = await AsyncFetcher.fetch_all([url], headers=headers, proxy=self.proxy)

# 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/duckduckgosearch.py
from theHarvester.discovery.constants import *
from theHarvester.lib.core import *
from theHarvester.parsers import myparser
import json



class SearchDuckDuckGo:

    def __init__(self, word, limit):
        self.word = word
        self.results = ""
        self.totalresults = ""
        self.dorks = []
        self.links = []
        self.database = 'https://duckduckgo.com/?q='
        self.api = 'https://api.duckduckgo.com/?q=x&format=json&pretty=1'  # Currently using API.
        self.quantity = '100'
        self.limit = limit
        self.proxy = False

    async def do_search(self):
        # Do normal scraping.
        url = self.api.replace('x', self.word)
        headers = {'User-Agent': googleUA}
        first_resp = await AsyncFetcher.fetch_all([url], headers=headers, proxy=self.proxy)

        self.results = first_resp[0]