def search_twitter(username): twitool = twitterSearchTool() twitool.getInfoProfile(username) username = twitool.username profilId = twitool.id name = twitool.name location = twitool.location url = twitool.url description = twitool.description protected = twitool.protected followers = twitool.followers friend = twitool.friends dateCreate = twitool.create geo = twitool.geo # verif = twitool.verified status = twitool.status langue = twitool.langue try: naissance = twitool.birth except: naissance = "None" print("\n[@%s]" % (username)) print("\n[+] Name: %s" % (name)) print("[+] Langue: %s" % (langue)) print("[+] Privee: %s" % (protected)) print("[+] ID: %s" % (profilId)) print("[+] Protected: %s" % (protected)) print("[+] Abonnees: %s | Abonnements: %s" % (followers, friend)) print("[+] Tweets: %s" % (status)) print("[+] Ville: %s" % (location)) print("[+] Naissance: %s" % (naissance)) print("[+] Url: %s" % (url)) print("[+] Create: %s" % (dateCreate)) print("[BIO]: %s" % (description))
def searchTwitter(): username = input(" Username: "******"None" print("\n[@%s]" % (username)) print("\n[+] Name: %s" % (name)) print("[+] Language: %s" % (langue)) print("[+] Private: %s" % (protected)) print("[+] ID: %s" % (profilId)) print("[+] Protected: %s" % (protected)) print("[+] Subscribers: %s | Subscriptions: %s" % (followers, friend)) print("[+] Tweets: %s" % (status)) print("[+] City: %s" % (location)) print("[+] Birth: %s" % (naissance)) print("[+] Url: %s" % (url)) print("[+] Create: %s" % (dateCreate)) print("[BIO]: %s" % (description))
def searchPersonne(codemonpays): nom = input(" Nom, Prénom: ") city = input(" Ville/Departement: ") print("\n"+wait+" Recherche...") try: headers = { 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36', 'referrer': 'https://google.com', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'utf-8', 'Accept-Language': 'en-US,en;q=0.9', 'Pragma': 'no-cache' } if codemonpays == 'FR': # Page Jaune search url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}" requete = requests.get(url.format(nom, city), headers=headers) searchPJ(requete) elif codemonpays == 'BE': # Page D'or search url = "https://www.pagesblanches.be/chercher/personne/{}/{}/" requete = requests.get(url.format(nom, city), headers=headers) searchPageDor(requete) elif codemonpays == 'CH': # Suisse search url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res" searchLocalCH(url.format(city, nom)) elif codemonpays == 'LU': # Luxembourg search url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}" searchYellowLU(url.format(nom)) else: # Recherche FR url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}" requete = requests.get(url.format(nom, city), headers=headers) searchPJ(requete) # Recherche BE url = "https://www.pagesblanches.be/chercher/personne/{}/{}/" requete = requests.get(url.format(nom, city), headers=headers) searchPageDor(requete) # Recherche CH url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res" searchLocalCH(url.format(city, nom)) # Recherche LU url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}" searchYellowLU(url.format(nom)) # Copain d'avant search searchCopainsdavant(nom, city) # LinkedIn search searchPersonneLinkedin(nom, city) # Facebook search fbtool = facebookSearchTool() accountsFb = fbtool.searchFacebook(nom) title = " Facebook " TABLE_DATA = [ ('Name', 'User', 'Location'), ] count = 0 for a in accountsFb: count += 1 name = a[1] username = a[0] fbtool.getInfoProfile(username) loc = fbtool.address if not loc: loc = "" tuples = (name, username, loc) # listeInfos.append(tuples) TABLE_DATA.append(tuples) if count > 0: table_instance = SingleTable(TABLE_DATA, title) print(table_instance.table) # Twitter Search title = " Twitter " TABLE_DATA = [ ('Name', 'User', 'Date', 'Location'), ] twitool = twitterSearchTool() accountTwitter = twitool.searchTwitter(nom) count = 0 for a in accountTwitter: count += 1 name = a[1] username = "******"+a[0] twitool.getInfoProfile(a[0]) location = twitool.location date = twitool.birth bio = twitool.description url = twitool.url tuples = (name, username, date, location) TABLE_DATA.append(tuples) if count > 0: table_instance = SingleTable(TABLE_DATA, title) print(table_instance.table) # Instagram search title = " Instagram " instatls = instagramSearchTool() instatls.searchInsta(nom) accounts = instatls.accounts TABLE_DATA = [ ('Name', 'User'), ] count = 0 for account in accounts: url = "https://instagram.com/"+account i = instagramSearchTool() i.getInfo(url) name = i.name tuples = (name, account) TABLE_DATA.append(tuples) count +=1 if count > 0: table = SingleTable(TABLE_DATA, title) print(table.table) except IOError: pass
def profilerFunc(profile='', path=''): from datetime import date today = date.today() instagramID = None instagramBio = None instagramUsername = None instagramName = None instagramEmail = None instagramPhone = None instagramUrlFound = None instagramLocation = None InstagramUrlAccount = None today = None profileID = None profileName = None phones = None emails = None twitterLocation = None facebookLocation = None facebookWork = None facebookUsername = None twitterUsername = None facebookID = None facebookUrl = None twitterID = None twitterUrlAccount = None placeVisited = None twitterBio = None list_biographi = [] list_placeVisited = [] list_emails = [] list_phones = [] list_urls = [] list_news = [] if profile: profileName = profile['name'] profileID = profile['id'] file = profile['file'] print("\n" + found + " Profile selected: %s (%s)\n" % (profileName, profileID)) pr = Profiler() dataProfile = pr.readProfile(file, path=path) if dataProfile: for data in dataProfile: if data.upper() == 'URL': try: url_twitter = dataProfile[data]['Twitter'] except: url_twitter = None try: url_instagram = dataProfile[data]['Instagram'] except: url_instagram = None try: url_facebook = dataProfile[data]['Facebook'] except: url_facebook = None name_txt = file.replace(".prfl", ".txt") path_txt = path + '\\' + name_txt if url_twitter: twitterInfoDic = {"Twitter": {}} twittool = twitterSearchTool() twittool.getInfoProfile(url_twitter) twitterID, twitterInfoDic['Twitter'][ 'id'] = twittool.id, twittool.id twitterName, twitterInfoDic['Twitter'][ 'name'] = twittool.name, twittool.name twitterUsername, twitterInfoDic['Twitter'][ 'username'] = twittool.username, twittool.username twitterLocation, twitterInfoDic['Twitter'][ 'location'] = twittool.location, twittool.location twitterUrlFound, twitterInfoDic['Twitter'][ 'urlFound'] = twittool.url, twittool.url twitterBio, twitterInfoDic['Twitter'][ 'description'] = twittool.description, twittool.description twitterUrlAccount, twitterInfoDic['Twitter'][ 'urlAccount'] = url_twitter, url_twitter if url_facebook: facebookInfoDic = {"Facebook": {}} fbtool = facebookSearchTool() fbtool.getInfoProfile(url_facebook) facebookID, facebookInfoDic['Facebook'][ 'id'] = fbtool.facebookId, fbtool.facebookId faecbookName, facebookInfoDic['Facebook'][ 'name'] = fbtool.name, fbtool.name facebookLocation, facebookInfoDic['Facebook'][ 'location'] = fbtool.address, fbtool.address facebookWork, facebookInfoDic['Facebook'][ 'job'] = fbtool.job, fbtool.job facebookUrl, facebookInfoDic['Facebook'][ 'urlAccount'] = url_facebook, url_facebook facebookUsername, facebookInfoDic['Facebook'][ 'username'] = fbtool.username, fbtool.username facebookAffiliation, facebookInfoDic['Facebook'][ 'affiliations'] = fbtool.affiliations, fbtool.affiliations if url_instagram: instagramInfoDic = {"Instagram": {}} instatool = instagramSearchTool() instatool.getInfo(url_instagram) instagramID, instagramInfoDic['Instagram'][ 'id'] = instatool.id, instatool.id instagramBio, instagramInfoDic['Instagram'][ 'description'] = instatool.biography, instatool.biography instagramUsername, instagramInfoDic['Instagram'][ 'username'] = instatool.username, instatool.username instagramName, instagramInfoDic['Instagram'][ 'name'] = instatool.name, instatool.name instagramEmail, instagramInfoDic['Instagram'][ 'email'] = instatool.email, instatool.email instagramPhone, instagramInfoDic['Instagram'][ 'phone'] = instatool.phone, instatool.phone instagramUrlFound, instagramInfoDic['Instagram'][ 'urlFound'] = url_instagram, url_instagram instagramLocation, instagramInfoDic['Instagram'][ 'location'] = instatool.adresse, instatool.adresse InstagramUrlAccount, instagramInfoDic['Instagram'][ 'urlAccount'] = instatool.urlAccount, instatool.urlAccount for data in dataProfile: if data.upper() == 'TWITTER': if dataProfile[data]['name'] != twitterName: dataProfile[data]['name'] = twitterName list_news.append(twitterName) if dataProfile[data]['location'] != twitterLocation: dataProfile[data]['location'] = twitterLocation list_news.append(twitterLocation) if dataProfile[data]['urlFound'] != twitterUrlFound: dataProfile[data]['urlFound'] = twitterUrlFound list_news.append(twitterUrlFound) if dataProfile[data]['description'] != twitterBio: dataProfile[data]['description'] = twitterBio list_news.append(twitterBio) elif data.upper() == "FACEBOOK": if dataProfile[data]['name'] != faecbookName: dataProfile[data]['name'] = faecbookName list_news.append(faecbookName) if dataProfile[data]['location'] != facebookLocation: dataProfile[data]['location'] = facebookLocation list_news.append(facebookLocation) if dataProfile[data]['job'] != facebookWork: dataProfile[data]['job'] = facebookWork list_news.append(facebookWork) if dataProfile[data]['affiliations'] != facebookAffiliation: dataProfile[data]['affiliations'] = facebookAffiliation list_news.append(facebookAffiliation) elif data.upper() == 'INSTAGRAM': if dataProfile[data]['name'] != instagramName: dataProfile[data]['name'] = instagramName list_news.append(instagramName) if dataProfile[data]['location'] != instagramLocation: dataProfile[data]['location'] = instagramLocation list_news.append(instagramLocation) if dataProfile[data]['urlFound'] != instagramUrlFound: dataProfile[data]['urlFound'] = instagramUrlFound list_news.append(instagramUrlFound) if dataProfile[data]['description'] != instagramBio: dataProfile[data]['description'] = instagramBio list_news.append(instagramBio) if url_twitter: dataProfile.update(twitterInfoDic) if url_facebook: dataProfile.update(facebookInfoDic) if url_instagram: dataProfile.update(instagramInfoDic) if url_twitter or url_facebook or url_instagram: pr.writeProfile(file, path, dataProfile) if instagramEmail: list_emails.append(instagramEmail) placeVisited = "; ".join(list_placeVisited) for bio in list_biographi: regex = RegexTool(bio) emails = regex.Email().email phones = regex.Telephone().telephone urls = regex.Url().url for email in emails: list_emails.append(email) for phone in phone: list_phone.append(phone) for url in urls: list_urls.append(urls) if list_emails: emails = ", ".join(list_emails) else: emails = '' if list_phones: phones = ", ".join(list_phones) else: phones = '' if list_urls: urls = ", ".join(list_urls) else: urls = '' global_info = """ Date: %s Profile ID : %s First name, Last name: %s Téléphone: %s Emails: %s Location: %s ; %s ; %s Profession: %s Nicknames: %s ; %s ; %s Facebook (%s) - %s Twitter (%s) - %s Instagram (%s) - %s Place visited: %s Descriptions: %s %s """ % (today, profileID, profileName, phones, emails, instagramLocation, twitterLocation, facebookLocation, facebookWork, facebookUsername, twitterUsername, instagramUsername, facebookID, facebookUrl, twitterID, twitterUrlAccount, instagramID, InstagramUrlAccount, placeVisited, twitterBio, instagramBio) lists = [] w = watcher() if url_instagram: w.instagramWatcher(url_instagram) lists.append(w.medias) if url_twitter: w.twitterWatcher(url_twitter) lists.append(w.tweet) if lists: data = pr.timeSort( lists, reverse=True ) # True: Ordre Decroissant, False: Ordre croissant (defaut : False) TABLE_DATA = [ ('Date', 'Domain', 'Publication', 'Location'), ] for d in data: date = time.ctime(d) domain = data[d]['domain'] if domain == "Twitter": tweet = data[d]['tweet'].replace( "https://twitter.com", '') tuples = (date, domain, tweet, 'None') TABLE_DATA.append(tuples) else: publication = data[d]['urlMedia'] publicationShort = shortCutUrl(publication) typePublication = data[d]['type'] localisation = data[d]['location'] if localisation: list_placeVisited.append(localisation) tuples = (date, domain, publicationShort, localisation) TABLE_DATA.append(tuples) tableLastPost = SingleTable(TABLE_DATA, " Last post ") print(tableLastPost.table) print("-------------") print("\n" + global_info) if len(list_news) > 0: newsItems = "; ".join(list_news) print("New Arrivals:\n" + newsItems) print("-------------") print(question + " Do you want to export the recovered data to '%s' ? " % (name_txt)) while True: choix = input("\n [O/n]: ") if choix == '' or choix.upper() == 'O': f = pr.exportText(name_txt, path, global_info) if f: print("\n" + found + " Data successfully exported !") print(" %s" % (path_txt)) else: print( "\n" + warning + " An error has occurred, the data could not be exported !" ) break elif choix.upper() == 'N': break print("\n" + question + " Do you want to create a copy of '%s' ? " % (name_txt)) while True: choix = input("\n [o/N]: ") if choix.upper() == 'O': print("\n" + question + " Or do you want to save the copy ?") pathDefault = os.getcwd() print(Fore.YELLOW + " Default path: " + pathDefault + Fore.RESET) path = input("\n Path: ") if not path: path = pathDefault path += "\\" if path.endswith(".txt"): path = path_txt else: path = path + name_txt with open(path, 'w', encoding="utf-8") as f: f.write(global_info) f.close() print("\n" + found + " '%s' has been successfully copied !" % (name_txt)) break elif choix == '' or choix.upper() == 'N': break else: print("\n" + warning + " Profile not found")
def searchPersonne(self ,text,person_lookup,nom,city,codemonpays): person_lookup.destroy() # nom = Entry() # nom.place(x=200,y=200) # nom = nom.get() # print(nom) # city = input(" Ville/Departement: ") # Progress bar widget progress = Progressbar(self, orient=HORIZONTAL, length=200, mode='determinate') progress.place(x=600, y=200) try: headers = { 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36', 'referrer': 'https://google.com', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'utf-8', 'Accept-Language': 'en-US,en;q=0.9', 'Pragma': 'no-cache' } progress['value'] = 5 self.update_idletasks() time.sleep(0.1) if codemonpays == 'FR': # Page Jaune search url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}" requete = requests.get(url.format(nom, city), headers=headers) searchPJ(progress,self,text, requete) elif codemonpays == 'BE': # Page D'or search url = "https://www.pagesblanches.be/chercher/personne/{}/{}/" requete = requests.get(url.format(nom, city), headers=headers) searchPageDor(text,self,requete) elif codemonpays == 'CH': # Suisse search url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res" searchLocalCH(progress,self,text,url.format(city, nom)) elif codemonpays == 'LU': # Luxembourg search url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}" searchYellowLU(url.format(nom)) else: # Recherche FR url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}" requete = requests.get(url.format(nom, city), headers=headers) searchPJ(progress,self,text, requete) # Recherche BE url = "https://www.pagesblanches.be/chercher/personne/{}/{}/" requete = requests.get(url.format(nom, city), headers=headers) searchPageDor(text,self,requete) # Recherche CH url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res" searchLocalCH(progress,self,text,url.format(city, nom)) # Recherche LU url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}" searchYellowLU(text,url.format(nom)) progress['value'] =10 self.update_idletasks() time.sleep(0.1) # Copain d'avant search searchCopainsdavant(text, nom, city) progress['value'] = 15 self.update_idletasks() time.sleep(0.1) # LinkedIn search searchPersonneLinkedin(self,progress,text, nom, city) # Facebook search fbtool = facebookSearchTool() accountsFb = fbtool.searchFacebook(nom) title = " Facebook " TABLE_DATA = [ ('Name', 'User', 'Location'), ] count = 0 progress['value'] = 25 self.update_idletasks() time.sleep(0.1) for a in accountsFb: count += 1 name = a[1] username = a[0] fbtool.getInfoProfile(username) loc = fbtool.address if not loc: loc = "" tuples = (name, username, loc) # listeInfos.append(tuples) TABLE_DATA.append(tuples) progress['value'] = 35 self.update_idletasks() time.sleep(0.1) if count > 0: table_instance = SingleTable(TABLE_DATA, title) text.insert(END,table_instance.table) # labl = Label(self, text=table_instance.table, bg="black", fg="green", # font=("comicsansms", 15, "bold"), relief=FLAT) # labl.place(x=20, y=2) # Twitter Search title = " Twitter " progress['value'] = 50 self.update_idletasks() time.sleep(0.1) TABLE_DATA = [ ('Name', 'User', 'Date', 'Location'), ] twitool = twitterSearchTool() accountTwitter = twitool.searchTwitter(nom) count = 0 for a in accountTwitter: count += 1 name = a[1] username = "******" + a[0] twitool.getInfoProfile(a[0]) location = twitool.location date = twitool.birth bio = twitool.description url = twitool.url tuples = (name, username, date, location) TABLE_DATA.append(tuples) if count > 0: table_instance = SingleTable(TABLE_DATA, title) text.insert(END,table_instance.table) # Instagram search title = " Instagram " instatls = instagramSearchTool() instatls.searchInsta(nom) accounts = instatls.accounts TABLE_DATA = [ ('Name', 'User'), ] count = 0 progress['value'] = 65 self.update_idletasks() time.sleep(0.1) for account in accounts: url = "https://instagram.com/" + account i = instagramSearchTool() i.getInfo(url) name = i.name tuples = (name, account) TABLE_DATA.append(tuples) count += 1 if count > 0: progress['value'] = 100 self.update_idletasks() time.sleep(0.1) progress.destroy() table = SingleTable(TABLE_DATA, title) text.insert(END,table.table) except IOError: progress['value'] = 50 self.update_idletasks() time.sleep(0.1) progress['value'] = 80 self.update_idletasks() time.sleep(0.1) progress.destroy() pass