Example #1
0
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 facebookStalk():
    profile = input(" Facebook username: "******"http"):
        profile = profile.split("/")
        profile = profile[3]

    menuStalk = """

        TAGS               PEOPLE                 PLACES
    ------------        -------------          -------------
    [1] Photos          [4] Family             [10] All
    [2] Videos          [5] Friends            [11] Bars
    [3] Publication     [6] Friends in common  [12] Restaurants
                        [7] Job                [13] Store
        LIKE            [8] Study              [14] Outside
    ------------        [9] Local              [15] Hotels
    [17] Photos                                [16] Theater
    [18] Videos           COMMENT
    [19] Publications   -------------          INTERESTS     
                        [20] Photos          -------------
        PROFIL                               [29] Pages
    -------------                            [30] Policies
    [21] Photos                              [31] Religion
    [22] Videos                              [32] Music
    [23] Publications                        [33] Movies
    [24] Groupes                             [34] Books
    [25] Future events                       [35] Places
    [26] Past events
    [27] Games
    [28] Apps

        [b] Back    [c] Clear screen    [e] Exit script
	"""

    dicFbStalk = {
        # <
        # TAGS
        "1": "https://www.facebook.com/search/%s/photos-of/intersect",
        "2": "https://www.facebook.com/search/%s/videos-of/intersect",
        "3": "https://www.facebook.com/search/%s/stories-tagged/intersect",
        # PERSONNE
        "4": "https://www.facebook.com/search/%s/relatives/intersect",
        "5": "https://www.facebook.com/search/%s/friends/intersect",
        "6": "https://www.facebook.com/search/%s/friends/friends/intersect",
        "7": "https://www.facebook.com/search/%s/employees/intersect/",
        "8":
        "https://www.facebook.com/search/%s/schools-attended/ever-past/intersect/students/intersect/",
        "9":
        "https://www.facebook.com/search/%s/current-cities/residents-near/present/intersect",
        # LEUX
        "10": "https://www.facebook.com/search/%s/places-visited/",
        "11":
        "https://www.facebook.com/search/%s/places-visited/110290705711626/places/intersect/",
        "12":
        "https://www.facebook.com/search/%s/places-visited/273819889375819/places/intersect/",
        "13":
        "https://www.facebook.com/search/%s/places-visited/200600219953504/places/intersect/",
        "14":
        "https://www.facebook.com/search/%s/places-visited/935165616516865/places/intersect/",
        "15":
        "https://www.facebook.com/search/%s/places-visited/164243073639257/places/intersect/",
        "16":
        "https://www.facebook.com/search/%s/places-visited/192511100766680/places/intersect/",
        # LIKE
        "17": "https://www.facebook.com/search/%s/photos-liked/intersect",
        "18": "https://www.facebook.com/search/%s/videos-liked/intersect",
        "19": "https://www.facebook.com/search/%s/stories-liked/intersect",
        # COMMENTAIRE
        "20": "https://www.facebook.com/search/%s/photos-commented/intersect",
        # PROFIL
        "21": "https://www.facebook.com/search/%s/photos-by/",
        "22": "https://www.facebook.com/search/%s/videos-by/",
        "23": "https://www.facebook.com/search/%s/stories-by/",
        "24": "https://www.facebook.com/search/%s/groups",
        "25": "https://www.facebook.com/search/%s/events-joined/",
        "26":
        "https://www.facebook.com/search/%s/events-joined/in-past/date/events/intersect/",
        "27":
        "https://www.facebook.com/search/%s/apps-used/game/apps/intersect",
        "28": "https://www.facebook.com/search/%s/apps-used/",
        # INTERETS
        "29": "https://www.facebook.com/search/%s/pages-liked/intersect",
        "30":
        "https://www.facebook.com/search/%s/pages-liked/161431733929266/pages/intersect/",
        "31":
        "https://www.facebook.com/search/%s/pages-liked/religion/pages/intersect/",
        "32":
        "https://www.facebook.com/search/%s/pages-liked/musician/pages/intersect/",
        "33":
        "https://www.facebook.com/search/%s/pages-liked/movie/pages/intersect/",
        "34":
        "https://www.facebook.com/search/%s/pages-liked/book/pages/intersect/",
        "35": "https://www.facebook.com/search/%s/places-liked/"
    }

    helpMsgFbStalk = """
		back : Return to main menu.
		exit / quit  : To exit the software.
		clear : Clear screen."""

    resultProfile = """
    [Name]  %s
    [work]  %s
    [Loc]   %s
    [ID]    %s"""

    fbtool = facebookSearchTool()

    try:
        fbtool.getInfoProfile(profile)

        loc = fbtool.address
        work = fbtool.job
        name = fbtool.name
        ID = fbtool.facebookId
        facebookID = ID

    except:
        print("\n" + warning + " An error has occurred !")

    while True:

        if not facebookID:
            print("\n" + warning + " Unable to retrieve ID.")
            print(question + "\n Do you know the id ?")
            _id_ = input(question + " [O/N]: ")
            if _id_.upper() == "O" or _id_.upper() == "Y":
                facebookID = input(" ID: ")
                input(facebookID)
            else:
                break

        print(resultProfile % (name, work, loc, ID))
        print(menuStalk)

        while True:
            s = input("\n LittleBrother(" + Fore.BLUE +
                      "Lookup/facebookStalk" + Fore.RESET + ")$ ")
            if s == "help":
                print(helpMsgFbStalk)
            elif s.lower() == "c":
                clear()
                print(menuStalk)
            elif s.lower() == "b":
                break
            elif s.lower() == "e":
                quit()
            else:
                if str(s) == '29':
                    pages = fbtool.searchPageLiked(profile)
                    for p in pages:
                        print("[Liked] %s" % (p))
                try:
                    int(s)
                    facebookUrl = dicFbStalk.get(str(s))
                    webbrowser.open(facebookUrl % (facebookID))
                except ValueError:
                    pass
        break
Example #3
0
def facebookStalk():
	profile = input(" Facebook username: "******"http"):
		profile = profile.split("/")
		profile = profile[3]

	menuStalk = """

        TAGS              PERSONNES              LIEUX
    ------------        -------------        -------------
    [1] Photos          [4] Famille          [10] Tout
    [2] Videos          [5] Amis             [11] Bars
    [3] Publication     [6] Amis en commun   [12] Restaurants
                        [7] Travail          [13] Magasin
        LIKE            [8] Etude            [14] Exterieur
    ------------        [9] Locaux           [15] Hotels
    [17] Photos                              [16] Theatre
    [18] Videos          COMMENTAIRE
    [19] Publications   -------------          INTERETS     
                        [20] Photos          -------------
        PROFIL                               [29] Pages
    -------------                            [30] Politiques
    [21] Photos                              [31] Religion
    [22] Videos                              [32] Musiques
    [23] Publications                        [33] Films
    [24] Groupes                             [34] Livres
    [25] Futur evenements                    [35] Lieux
    [26] Evenements passes
    [27] Jeux
    [28] Apps

        [b] Back    [c] Clear screen    [e] Exit script
	"""

	dicFbStalk = {
	# <
	# TAGS 
	"1": "https://www.facebook.com/search/%s/photos-of/intersect",
	"2": "https://www.facebook.com/search/%s/videos-of/intersect",
	"3": "https://www.facebook.com/search/%s/stories-tagged/intersect",
	# PERSONNE
	"4": "https://www.facebook.com/search/%s/relatives/intersect",
	"5": "https://www.facebook.com/search/%s/friends/intersect",
	"6": "https://www.facebook.com/search/%s/friends/friends/intersect",
	"7": "https://www.facebook.com/search/%s/employees/intersect/",
	"8": "https://www.facebook.com/search/%s/schools-attended/ever-past/intersect/students/intersect/",
	"9": "https://www.facebook.com/search/%s/current-cities/residents-near/present/intersect",
	# LEUX
	"10": "https://www.facebook.com/search/%s/places-visited/",
	"11": "https://www.facebook.com/search/%s/places-visited/110290705711626/places/intersect/",
	"12": "https://www.facebook.com/search/%s/places-visited/273819889375819/places/intersect/",
	"13": "https://www.facebook.com/search/%s/places-visited/200600219953504/places/intersect/",
	"14": "https://www.facebook.com/search/%s/places-visited/935165616516865/places/intersect/",
	"15": "https://www.facebook.com/search/%s/places-visited/164243073639257/places/intersect/",
	"16": "https://www.facebook.com/search/%s/places-visited/192511100766680/places/intersect/",
	# LIKE
	"17": "https://www.facebook.com/search/%s/photos-liked/intersect",
	"18": "https://www.facebook.com/search/%s/videos-liked/intersect",
	"19": "https://www.facebook.com/search/%s/stories-liked/intersect",
	# COMMENTAIRE
	"20": "https://www.facebook.com/search/%s/photos-commented/intersect",
	# PROFIL
	"21": "https://www.facebook.com/search/%s/photos-by/",
	"22": "https://www.facebook.com/search/%s/videos-by/",
	"23": "https://www.facebook.com/search/%s/stories-by/",
	"24": "https://www.facebook.com/search/%s/groups",
	"25": "https://www.facebook.com/search/%s/events-joined/",
	"26": "https://www.facebook.com/search/%s/events-joined/in-past/date/events/intersect/",
	"27": "https://www.facebook.com/search/%s/apps-used/game/apps/intersect",
	"28": "https://www.facebook.com/search/%s/apps-used/",
	# INTERETS
	"29": "https://www.facebook.com/search/%s/pages-liked/intersect",
	"30": "https://www.facebook.com/search/%s/pages-liked/161431733929266/pages/intersect/",
	"31": "https://www.facebook.com/search/%s/pages-liked/religion/pages/intersect/",
	"32": "https://www.facebook.com/search/%s/pages-liked/musician/pages/intersect/",
	"33": "https://www.facebook.com/search/%s/pages-liked/movie/pages/intersect/",
	"34": "https://www.facebook.com/search/%s/pages-liked/book/pages/intersect/",
	"35": "https://www.facebook.com/search/%s/places-liked/"
	}

	helpMsgFbStalk = """
		back : Revenir au menu principal.
		exit / quit  : Pour quitter le logiciel.
		clear : Efface l'ecran."""

	resultProfile = """
    [Name]  %s
    [work]  %s
    [Loc]   %s
    [ID]    %s"""

	fbtool = facebookSearchTool()

	try:
		fbtool.getInfoProfile(profile)
		
		loc = fbtool.address
		work = fbtool.job
		name = fbtool.name
		ID = fbtool.facebookId
		facebookID = ID

	except:
		print("\n"+warning+" Une erreur est survenue !")

	while True:

		if not facebookID:
			print("\n"+warning+" Impossible de recuperer l'ID.")
			print(question+"\n Connaissez-vous l'ID ?")
			_id_  = input(question+" [O/N]: ")
			if _id_.upper() == "O" or _id_.upper() == "Y":
				facebookID = input(" ID: ")
				input(facebookID) 
			else:
				break

		print(resultProfile % (name, work, loc, ID))
		print(menuStalk)
		
		while True:
			s = input("\n LittleBrother("+Fore.BLUE + "Lookup/facebookStalk" + Fore.RESET + ")$ ")
			if s == "help":
				print(helpMsgFbStalk)
			elif s.lower() == "c":
				clear()
				print(menuStalk)
			elif s.lower() == "b":
				break
			elif s.lower() == "e":
				quit()
			else:
				if str(s) == '29':
					pages = fbtool.searchPageLiked(profile)
					for p in pages:
						print("[Liked] %s" % (p))
				try:
					int(s)
					facebookUrl = dicFbStalk.get(str(s))
					webbrowser.open(facebookUrl % (facebookID))
				except ValueError:
					pass
		break
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")
Example #5
0
import sys
import threading
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
import webbrowser

from core.facebookSearchTool import facebookSearchTool

fbtool = facebookSearchTool()

dicFbStalk = {
    "Tags": {
        "Pictures":
        "https://www.facebook.com/search/%s/photos-of/intersect",
        "Videos":
        "https://www.facebook.com/search/%s/videos-of/intersect",
        "Publications":
        "https://www.facebook.com/search/%s/stories-tagged/intersect",
    },
    "Persons": {
        "Family":
        "https://www.facebook.com/search/%s/relatives/intersect",
        "Friends":
        "https://www.facebook.com/search/%s/friends/intersect",
        "Common friends":
        "https://www.facebook.com/search/%s/friends/friends/intersect",
        "Collegues / Employees":
        "https://www.facebook.com/search/%s/employees/intersect/",
        "School":
        "https://www.facebook.com/search/%s/schools-attended/ever-past/intersect/students/intersect/",
Example #6
0
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