Last active
November 5, 2020 09:55
-
-
Save elmoiv/2a6d41459d10827619c0c5f099d4bf17 to your computer and use it in GitHub Desktop.
Getting ID of any facebook user without scraping.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, urllib.request | |
query = input() | |
rgx = re.split(r'((http|https):\/\/)?(www\.)?(facebook|fb)\.com\/([.a-z0-9]+)', query.lower()) | |
name = rgx[0] if len(rgx) == 1 else rgx[5] | |
redirected = urllib.request.urlopen(f'https://m.me/{name}').geturl().split('%2F') | |
ID = 'Not Found!' if len(redirected) < 2 else redirected[-2] | |
print('ID:', ['Not Found!', ID][ID.isdecimal()]) | |
# You can message yourself by adding your ID to messenger base | |
# my_messenger_url = 'https://www.messenger.com/t/' + Your_ID | |
# And voice call yourself too 😂 | |
# voice_call_url = 'https://www.messenger.com/videocall/incall/?peer_id=' + Your_ID | |
# Have fun :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment