Skip to content

Instantly share code, notes, and snippets.

View nix010's full-sized avatar

Nix nix010

View GitHub Profile
@nix010
nix010 / FbContactCrawler.py
Last active September 27, 2022 21:40
Crawl Facebook profile of user by user fbid
import json
from pprint import pprint
import requests
from bs4 import BeautifulSoup as BS
import facebook
class FbBaseCrawler(object):
default_headers = {
'Accept' :'*/*',
What industry do you want to find ? : football
crawl_now123123
{'100002702009223': {'owner_name': 'Lê Hoàng Trung'}, '100014229676316': {'owner_name': 'Hoài Nam'}}
Page 1 completed
{'100014229676316': {'owner_name': 'Hoài Nam'}, '100002702009223': {'owner_name': 'Lê Hoàng Trung'}, '100009394937400': {'owner_name': 'Thuỳ Nguyên'}}
Page 2 completed
{'100014229676316': {'owner_name': 'Hoài Nam'}, '100003842806973': {'owner_name': 'Hữu Nhẫn Võ'}, '100002702009223': {'owner_name': 'Lê Hoàng Trung'}}
Page 3 completed
{'100002702009223': {'owner_name': 'Lê Hoàng Trung'}, '100002217636076': {'owner_name': 'Huỳnh Hanh Thông'}}
Page 4 completed
import json
from pprint import pprint
from datetime import datetime
import requests
from facebook_user_crawler import FbBaseCrawler
"""
FbBaseCrawler can be found here https://gist.github.com/gearazk/7e5a7178dfdee70222bdeb9d8e8d155e
"""
class FbUserListCrawler(FbBaseCrawler):
import concurrent.futures
from time import time
def count_digits(input_str):
count = {}
for s in input_str:
if s.isdigit():
count[s] = count.get(s, 0) + 1
return count