예제 #1
0
def google_scraper(temp):
	
	links = []
	count = 1
	for link in duckduckgo.search(temp, max_results=16):
		if count%4==0:
			links.append(link)
			count += 1
		else:
			count += 1	

	ID = "kaisahai" + str(random.random())
	url_1 = links[1]
	image = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSlJ6i0MqP20vfAwE1bCofPt6bKDQ27NA_GUrtR28GYHq1Xf67P"
	title_1 = links[1].split('/')[2]
	source_1 = links[1].split('/')[2]
	temp_1 = {'url' : url_1, 'imageURL': image, 'title':title_1,'source':source_1, 'id':ID}
 
 	ID = "kaisahai" + str(random.random())
	url_2 = links[3]
	image = "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSlJ6i0MqP20vfAwE1bCofPt6bKDQ27NA_GUrtR28GYHq1Xf67P"
	title_2 = links[3].split('/')[2]
	source_2 = links[3].split('/')[2]
	temp_2 = {'url' : url_1, 'imageURL': image, 'title':title_2,'source':source_2, 'id':ID}

	return temp_1,temp_2 
def check_duckduckgoInfo(email):
	try:
		links = duckduckgo.search(email, max_results=10)
		for link in links:
			print "|--[INFO][DuckDuckGO][SEARCH][>] " + str(link)
	except:
		print colores.alert + "|--[WARNING][DUCKDUCKGO][>] Error..." + colores.normal
예제 #3
0
def check_duckduckgo_smart_info(email: str) -> None:
    no_company = ("gmail", " hotmail", " yahoo", " protonmail", " mail")
    split1: List[str] = email.split("@")
    name: str = split1[0].replace(".", " ")
    split2: List[str] = split1[1].split(".")
    company: str = split2[0].replace(".", "")

    data: str
    if company in no_company:
        data = name
    else:
        data = f"{name} {company}"

    links: Generator = duckduckgo.search(data, max_results=10)
    for link in links:
        link_as_str = str(link)
        print(f"|--[INFO][DuckDuckGO][SMART SEARCH][>] {link_as_str}")
        if "linkedin.com/in/" in link_as_str:
            print(
                f"{colores['green']}|----[>][POSSIBLE LINKEDIN DETECT] ----{colores['normal']}"
            )
        if "twitter.com" in link_as_str:
            print(
                f"{colores['green']}|----[>][POSSIBLE TWITTER DETECT] ----{colores['normal']}"
            )
        if "facebook.com" in link_as_str:
            print(
                f"{colores['green']}|----[>][POSSIBLE FACEBOOK DETECT] ----{colores['normal']}"
            )
        if "soundcloud.com/" in link_as_str:
            print(
                f"{colores['green']}|----[>][POSSIBLE SOUNDCLOUD DETECT] ----{colores['normal']}"
            )
예제 #4
0
def extractUrls(dorks):
    temp = []
    for dork in open(dorks, "r").readlines():
        for link in search(dork.strip(), max_results=400):
            if link not in temp:
                temp.append(link)
    return temp
예제 #5
0
 def test_detect_no_results(self):
     """
     Check that we correctly identify a 'no results' situation from the
     live search engine.
     """
     noresults = "\"%s\"" % "".join(['fjdka', 'fdasfda', 'toitjfg'])
     self.assertEqual([], list(duckduckgo.search(noresults, max_results=5)))
예제 #6
0
 def test_detect_no_results(self):
     """
     Check that we correctly identify a 'no results' situation from the
     live search engine.
     """
     noresults = "\"%s\"" % "".join(['fjdka', 'fdasfda', 'toitjfg'])
     self.assertEqual([],
                      list(duckduckgo.search(noresults, max_results=5)))
예제 #7
0
def get_duckduckgoInfo(email):
	try:
		links = duckduckgo.search(email, max_results=10)
		for link in links:
			if "delsexo.com" in str(link):
				pass
			else:
				print "INFO:DuckDuckGO:SEARCH> " + str(link)
	except:
		print colores.alert + "|--[WARNING][DUCKDUCKGO][>] F**k!" + colores.normal
예제 #8
0
def extractUrls(dorks):
    temp = []
    urls = []
    for dork in open(dorks, 'r').readlines():
        for link in search(dork.strip(), max_results=100):
            temp.append(link)
        for url in temp:
            if url not in urls:
                urls.append(url)
    return urls
예제 #9
0
def check_duckduckgo_info(email: str) -> None:
    try:
        links: Generator = duckduckgo.search(email, max_results=10)
        for link in links:
            if "delsexo.com" not in str(link):
                print(f"|--[INFO][DuckDuckGO][SEARCH][>] {link}")
    except Exception:
        print(
            f"{colores['alert']}|--[WARNING][DUCKDUCKGO][>] Error...{colores['normal']}"
        )
예제 #10
0
def getCompleteUrl(query):
    time.sleep(1)
    try:
        print('Searching for:', query)
        for j in search(query, max_results=10):
            if j.startswith(query):
                return j
            else:
                print('result:', j)
    except Exception as e:
        print('Exception in search:', e)
예제 #11
0
def serveSuccess(name):
    for link in duckduckgo.search(name, 10):
        url = link
        break
    player = PlayerProfile(url, bs)

    data = {}
    data['query'] = name
    data['duck_source'] = url
    data['tranfermarkt_image_figurina'] = player.PlayerData.img

    json_data = json.dumps(data)
    return json_data
def Searchduckduckgo(domain):
    try:
        url_scan = []
        dork1 = "site:" + domain + " " + "inurl:.php?id="
        links = duckduckgo.search(dork1, max_results=10)
        for link in links:
            url_scan.append(str(link))
        l = len(url_scan)
        if l < 2:
            print "|----[WARNING] The search hasn't results with 'inurl:.php?id='."
            return None
        else:
            print "|----[INFO] Founds the result: " + str(l)
            return url_scan
    except Exception as e:
        print e
예제 #13
0
def check_duckduckgoSmartInfo(email):
	no_company = ("gmail"," hotmail"," yahoo"," protonmail"," mail")
	split1 = email.split("@")
	name = split1[0].replace("."," ")
	split2 = split1[1].split(".")
	company = split2[0].replace(".", "")
	if company in no_company:
		data = name
	else:
		data = name + " " + company
	links = duckduckgo.search(data, max_results=10)
	for link in links:
		print "|--[INFO][DuckDuckGO][SMART SEARCH][>] " + str(link)
		if "linkedin.com/in/" in str(link):
			print colores.green + "|----[>][POSSIBLE LINKEDIN DETECT] ----" + colores.normal
		if "twitter.com" in str(link):
			print colores.green + "|----[>][POSSIBLE TWITTER DETECT] ----" + colores.normal
		if "facebook.com" in str(link):
			print colores.green + "|----[>][POSSIBLE FACEBOOK DETECT] ----" + colores.normal
		if "soundcloud.com/" in str(link):
			print colores.green + "|----[>][POSSIBLE SOUNDCLOUD DETECT] ----" + colores.normal
예제 #14
0
def main():
    """Controls the flow of the ddg application"""

    'Build the parser and parse the arguments'
    parser = argparse.ArgumentParser(
        description='www.duckduckgo.com zero-click api for your command-line'
    )
    parser.add_argument('query', nargs='*', help='the search query')
    parser.add_argument('-b', '--bang', action='store_true',
                        help='open the !bang redirect url in a new browser tab')
    parser.add_argument('-d', '--define', action='store_true',
                        help='return the definition result')
    parser.add_argument('-j', '--json', action='store_true',
                        help='return the zero-click info api json response')
    parser.add_argument('-l', '--lucky', action='store_true',
                        help='open the result url in a new browser tab')
    parser.add_argument('-s', '--search', action='store_true',
                        help='launch a DuckDuckGo search in a new browser tab')
    parser.add_argument('-u', '--url', action='store_true',
                        help='return the result url')
    args = parser.parse_args()

    'Get the queries'
    if args.query:
        queries = [' '.join(args.query)]
    elif not sys.stdin.isatty():
        queries = sys.stdin.read().splitlines()
    else:
        parser.print_help()
        return

    'Determine if we need to add any prefixes based on user flags'
    prefix = '!ddg ' if args.search else '!' if args.bang else ''

    'Loop through each query'
    for query in queries:
        'Prefix the query'
        query = prefix + query

        'Get a response from api.duckduck.com using the duckduckgo module'
        results = duckduckgo.search(query)

        'If results is null, continue to the next query'
        if not results:
            continue

        'Print the raw json output and return'
        if args.json:
            print_result(results.json)
            continue

        'a list of where to look for an answer first'
        results_priority = get_results_priority(args)

        'do we want the text or url output of the answer found'
        var = get_text_or_url(args)

        'action to perform when an answer is found'
        action = get_action(args)

        'Search for an answer and perform an action'
        failed_to_find_answer = True
        for r in results_priority:
            result = getattr(getattr(results, r), var)
            if result:
                action(result)
                failed_to_find_answer = False
                break

        'Let the user know if no answer was found'
        if failed_to_find_answer:
            if results.type == 'disambiguation':
                print 'Your query was ambiguous, please be more specific'
            else:
                print 'No results found'
예제 #15
0
        message = (
            "Currently, @CryptoBotHunter detected {} #Twitter #crypto #bots.\n"
            "Detailed list is available here: {}").format(
                len(pseudos), pbin_url)
        try:
            api.update_status(message)
        except:
            print("api.update_status()")


if __name__ == '__main__':
    while True:
        pattern = random.choice(patterns)
        search = str.join(' ', pattern)
        print(search)
        #result = GoogleSearch().search(search, num_results=100)
        result = duckduckgo.search(search, max_results=100)
        parse_google_web_search(result, pattern)

        publish_summary_tweet()
        time.sleep(DELAY_BETWEEN_PUBLICATION)

        for p in list(pseudos):
            url = get_profile_picture_url("https://twitter.com/{}".format(p))

            if url:
                google_image_search(url)

            publish_tweet(p, pseudos[p])
            time.sleep(DELAY_BETWEEN_PUBLICATION)
예제 #16
0
import duckduckgo
urls = open("./urls_politica.txt", "w+")
for link in duckduckgo.search('site:www.ansa.it/sito/notizie/politica',
                              max_results=400):
    urls.write(link + "\n")
    print link
urls.close()
예제 #17
0
 def test_get_some_results(self):
     """
     Check that we're actually getting some URLS for a common search term.
     """
     results = list(duckduckgo.search('test', max_results=5))
     self.assertEqual(5, len(results))
예제 #18
0
def cmd_ddg(self, nick, args, admin):
    """Használat: !ddg query"""
    if not args:
        return cmd_help(nick, 'ddg', admin)
    else:
        return duckduckgo.search(args)
예제 #19
0
def cmd_ddg(nick, args, admin):
    """Használat: !ddg query"""
    if not args:
        return cmd_help(nick, 'ddg', admin)
    else:
        return duckduckgo.search(args)
예제 #20
0
headers['Accept'] = \
    'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
headers['Accept-Encoding'] = 'gzip, defalte'
headers['Connection'] = 'keep-alive'
headers['User-Agent'] = \
    'Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0'
temp = []
t_data = ['imdb', 'rotten']
count = 0
for x in range(0, len(movie)):
    try:
        if int(movie[x]['releasedate'][0]) >= YEAR:
            name = movie[x]['name'][0]
            print(name)
            count = count + 1
            rr = search(name)
            time.sleep(.2)
            soupp = BeautifulSoup(rr, 'html.parser')
            souppp = soupp.select(".result__url")
            data = {}
            data[t_data[0]] = ""
            data[t_data[1]] = ""
            for y in t_data:
                for x in souppp:
                    result = str(x).find(y)
                    if (result != -1):
                        data[y] = x['href']
                        break
            data['name'] = name
            pprint(data)
            temp.append(json.dumps(data))
예제 #21
0
 def test_get_some_results(self):
     """
     Check that we're actually getting some URLS for a common search term.
     """
     results = list(duckduckgo.search('test', max_results=5))
     self.assertEqual(5, len(results))
예제 #22
0
파일: ddg.py 프로젝트: alvations/ddg
def main():
    """Controls the flow of the ddg application"""

    'Build the parser and parse the arguments'
    parser = argparse.ArgumentParser(
        description='www.duckduckgo.com zero-click api for your command-line')
    parser.add_argument('query', nargs='*', help='the search query')
    parser.add_argument(
        '-b',
        '--bang',
        action='store_true',
        help='open the !bang redirect url in a new browser tab')
    parser.add_argument('-d',
                        '--define',
                        action='store_true',
                        help='return the definition result')
    parser.add_argument('-j',
                        '--json',
                        action='store_true',
                        help='return the zero-click info api json response')
    parser.add_argument('-l',
                        '--lucky',
                        action='store_true',
                        help='open the result url in a new browser tab')
    parser.add_argument('-s',
                        '--search',
                        action='store_true',
                        help='launch a DuckDuckGo search in a new browser tab')
    parser.add_argument('-u',
                        '--url',
                        action='store_true',
                        help='return the result url')
    args = parser.parse_args()

    'Get the queries'
    if args.query:
        queries = [' '.join(args.query)]
    elif not sys.stdin.isatty():
        queries = sys.stdin.read().splitlines()
    else:
        parser.print_help()
        return

    'Determine if we need to add any prefixes based on user flags'
    prefix = '!ddg ' if args.search else '!' if args.bang else ''

    'Loop through each query'
    for query in queries:
        'Prefix the query'
        query = prefix + query

        'Get a response from api.duckduck.com using the duckduckgo module'
        results = duckduckgo.search(query)

        'If results is null, continue to the next query'
        if not results:
            continue

        'Print the raw json output and return'
        if args.json:
            print_result(results.json)
            continue

        'a list of where to look for an answer first'
        results_priority = get_results_priority(args)

        'do we want the text or url output of the answer found'
        var = get_text_or_url(args)

        'action to perform when an answer is found'
        action = get_action(args)

        'Search for an answer and perform an action'
        failed_to_find_answer = True
        for r in results_priority:
            result = getattr(getattr(results, r), var)
            if result:
                action(result)
                failed_to_find_answer = False
                break

        'Let the user know if no answer was found'
        if failed_to_find_answer:
            if results.type == 'disambiguation':
                print 'Your query was ambiguous, please be more specific'
            else:
                print 'No results found'
예제 #23
0
파일: ddg.py 프로젝트: sigmavirus24/ddg
def main():
    """Controls the flow of the ddg application"""

    'Build the parser and parse the arguments'
    parser = argparse.ArgumentParser(
        description='www.duckduckgo.com zero-click api for your command-line'
    )
    parser.add_argument('query', nargs='*', help='the search query')
    parser.add_argument('-b', '--bang', action='store_true',
                        help='prefix query with ! and launch the redirect url')
    parser.add_argument('-d', '--define', action='store_true',
                        help='prefix query with define')
    parser.add_argument('-j', '--json', action='store_true',
                        help='returns the raw json output')
    parser.add_argument('-l', '--lucky', action='store_true',
                        help='launch the first url found')
    parser.add_argument('-s', '--search', action='store_true',
                        help='launch a search on www.duckduckgo.com')
    parser.add_argument('-u', '--url', action='store_true',
                        help='return the url of the result found')
    args = parser.parse_args()

    'Get the queries'
    if args.query:
        queries = [' '.join(args.query)]
    elif not sys.stdin.isatty():
        queries = sys.stdin.read().splitlines()
    else:
        parser.print_help()
        return

    'Determine if we need to add any prefixes based on user flags'
    prefix = 'define ' if args.define else ''

    if args.search:
        prefix = '!ddg ' + prefix
    elif args.bang:
        prefix = '!' + prefix

    'Loop through each query'
    for query in queries:
        'Prefix the query'
        query = prefix + query

        'Get a response from www.duckduck.com using the duckduckgo module'
        results = duckduckgo.search(query)

        'If the user requested the raw JSON output, print it now and continue to the next query'
        if args.json:
            print results.json
            continue

        'Define a response priority to determine what order to look for an answer'
        redirect_mode = args.bang or args.search or args.lucky
        results_priority = ['redirect', 'result', 'abstract'] if redirect_mode else ['answer',  'abstract', 'result']

        'Insert the definition priority at the front or second to last depending on the -d flag'
        results_priority.insert(0 if args.define else len(results_priority) - 1, 'definition')

        'Search for an answer and respond accordingly based on user input args'
        failed_to_find_answer = True
        for r in results_priority:
            result = getattr(getattr(results, r), 'url' if (redirect_mode or args.url) else 'text')
            if result:
                webbrowser.open_new_tab(result) if (redirect_mode and not args.url) else print_result(result)
                failed_to_find_answer = False
                break

        'Let the user know if no answer was found'
        if failed_to_find_answer:
            if results.type == 'disambiguation':
                print 'Your query was ambiguous, please be more specific'
            else:
                print 'No results found'
예제 #24
0
파일: ddg.py 프로젝트: garymonson/ddg
def main():
    """Controls the flow of the ddg application"""

    "Build the parser and parse the arguments"
    parser = argparse.ArgumentParser(description="www.duckduckgo.com zero-click api for your command-line")
    parser.add_argument("query", nargs="*", help="the search query")
    parser.add_argument("-b", "--bang", action="store_true", help="open the !bang redirect url in a new browser tab")
    parser.add_argument("-d", "--define", action="store_true", help="return the definition result")
    parser.add_argument("-j", "--json", action="store_true", help="return the zero-click info api json response")
    parser.add_argument("-l", "--lucky", action="store_true", help="open the result url in a new browser tab")
    parser.add_argument("-s", "--search", action="store_true", help="launch a DuckDuckGo search in a new browser tab")
    parser.add_argument("-u", "--url", action="store_true", help="return the result url")
    args = parser.parse_args()

    "Get the queries"
    if args.query:
        queries = [" ".join(args.query)]
    elif not sys.stdin.isatty():
        queries = sys.stdin.read().splitlines()
    else:
        parser.print_help()
        return

    "Determine if we need to add any prefixes based on user flags"
    prefix = "!ddg " if args.search else "!" if args.bang else ""

    "Loop through each query"
    for query in queries:
        "Prefix the query"
        query = prefix + query

        "Get a response from api.duckduck.com using the duckduckgo module"
        results = duckduckgo.search(query)

        "If results is null, continue to the next query"
        if not results:
            continue

        "Print the raw json output and return"
        if args.json:
            print_result(results.json)
            continue

        "a list of where to look for an answer first"
        results_priority = get_results_priority(args)

        "do we want the text or url output of the answer found"
        var = get_text_or_url(args)

        "action to perform when an answer is found"
        action = get_action(args)

        "Search for an answer and perform an action"
        failed_to_find_answer = True
        for r in results_priority:
            result = getattr(getattr(results, r), var)
            if result:
                action(result)
                failed_to_find_answer = False
                break

        "Let the user know if no answer was found"
        if failed_to_find_answer:
            if results.type == "disambiguation":
                print "Your query was ambiguous, please be more specific"
            else:
                print "No results found"
예제 #25
0
import duckduckgo

results = duckduckgo.search('test', max_results=2)
for res in results:
    print(res)