Skip to content

Commit

Permalink
Update Google Search
Browse files Browse the repository at this point in the history
Google search package integreted, 3rd partysearch website removed, code cleaned
  • Loading branch information
calganaygun committed Nov 26, 2020
1 parent a9b6ceb commit d1893cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 26 deletions.
34 changes: 8 additions & 26 deletions modules/Googling.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
from bs4 import BeautifulSoup
import re, requests
from googlesearch import search
from insides.bcolors import bcolors


def Googling(mail,_verbose=None):
if _verbose != None:
try:
print(f"{bcolors.WARNING} -- Google Searching... [Pastebin & Throwbin]{bcolors.ENDC}")
print(f"{bcolors.FAIL}!{bcolors.ENDC}"+"Google Search may not work properly.")
print("")
x = mail.replace("@", "%40")
searchurlP="https://s.sudonull.com/?q=site%3Apastebin.com+intext%3A%22"
u = (searchurlP+x+"%22")
response = requests.get(u)
html = response.content
soup=BeautifulSoup(html,"html.parser")
rgx = str(soup)
urls = re.findall('http[s]?://pastebin.com(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+<', rgx)
for x in range(len(urls)):
p = urls[x].replace("<", "")
print(f"{bcolors.OKGREEN}|-- {bcolors.ENDC}"+p)
x = mail.replace("@", "%40")
searchurlT="https://s.sudonull.com/?q=site%3Athrowbin.io+intext%3A%22"
u = (searchurlT+x+"%22")
response = requests.get(u)
html = response.content
soup=BeautifulSoup(html,"html.parser")
rgx = str(soup)
urls = re.findall('http[s]?://throwbin.io(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+<', rgx)
for x in range(len(urls)):
t = urls[x].replace("<", "")
print(f"{bcolors.OKGREEN}|-- {bcolors.ENDC}"+t)
print(f"{bcolors.FAIL}!{bcolors.ENDC}"+"Google Search may not work properly.\n")
urls = search(f'site:throwbin.io intext:"{mail}"') + search(f'site:pastebin.com intext:"{mail}"')
if len(urls):
for x in urls:
print(f"{bcolors.OKGREEN}|-- {bcolors.ENDC}"+x)
else:
print(f"{bcolors.FAIL}No Google Search result found!{bcolors.ENDC}")
except:
print(f"{bcolors.FAIL}Google Search error!{bcolors.ENDC}")
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ prettytable==0.7.2
anytree==2.8.0
beautifulsoup4==4.9.3
socialscan==1.4.1
googlesearch-python

0 comments on commit d1893cb

Please sign in to comment.