Skip to content

Instantly share code, notes, and snippets.

@xnohat
Forked from paulschreiber/fb-id.py
Created March 14, 2021 11:18
Show Gist options
  • Save xnohat/f675ba7a582a2a9d4d1da65d44e28701 to your computer and use it in GitHub Desktop.
Save xnohat/f675ba7a582a2a9d4d1da65d44e28701 to your computer and use it in GitHub Desktop.
Facebook User ID fetcher
#!/usr/bin/python
import requests
import re
url = 'https://www.facebook.com/zuck'
idre = re.compile('"entity_id":"([0-9]+)"')
page = requests.get(url)
print idre.findall(page.content)
# One-liner
# python -c 'import requests, re; print re.findall("\"entity_id\":\"([0-9]+)\"", requests.get("https://facebook.com/zuck").content)[0] + "\n"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment