It is recomended to use via pyenv We will be supporting python 3.6.0 and above going forward
curl https://pyenv.run | bash
pyenv install 3.6.0
pyenv local 3.6.0
pip install -r requirements.txt
Now all you need is a quickstart script into your computer, go ahead and run it in the command prompt as:
python quickstart.py --username abc@gmail.com --userid abc.pqr --password 123
PRO: Read about difference between username and userid for facebook: https://www.facebook.com/help/211813265517027?helpref=faq_content
session = FacebookPy(username="abc", password="123")
- Actions
- Following by a list
- Follow someone else's followers
- Follow the likers of posts of users
- Friending a user
- Friending by a list
- UnFriending by a list
- UnFriending by url list
- Confirm friends received
- Add suggested friends
- Invite friends to page
- Add members of group
- Add likers from term
- Withdraw outgoing friends requests
session.set_do_follow(enabled=True, percentage=10, times=2)
session.set_dont_like(['#exactmatch', '[startswith', ']endswith', 'broadmatch'])
session.set_ignore_users(['random_user', 'another_username'])
session.set_dont_include(['friend1', 'friend2', 'friend3'])
session.set_quota_supervisor(
Settings, enabled=True,
sleep_after=["likes", "comments_d", "follows", "unfollows", "server_calls_h"],
sleepyhead=True,
stochastic_flow=True,
notify_me=True,
peak_likes=(57, 585),
peak_comments=(21, 182),
peak_follows=(48, None),
peak_unfollows=(35, 402),
peak_server_calls=(None, 4700))
follow_by_list(followlist=['samantha3', 'larry_ok'], times=1, sleep_delay=600, interact=False)
only follows a user once (if unfollowed again) would be useful for the precise targeting
sleep_delay
is used to define break time after some good following (averagely ~10
follows)
For example, if one needs to get followbacks from followers of a chosen account/group of accounts.
accs = ['therock','natgeo']
session.follow_by_list(accs, times=1, sleep_delay=600, interact=False)
- You can also interact with the followed users by enabling
interact=True
which will use the configuration ofset_user_interact
setting:
session.set_user_interact(amount=4, percentage=50, randomize=True, media='Photo')
session.follow_by_list(followlist=['samantha3', 'larry_ok'], times=2, sleep_delay=600, interact=True)
session.follow_user_followers(['friend1', 'friend2', 'friend3'], amount=10, randomize=False)
session.follow_user_followers(['friend1', 'friend2', 'friend3'], amount=10, randomize=False, sleep_delay=60)
Note: simulation takes place while running this feature.
session.follow_likers(['user1' , 'user2'], photos_grab_amount = 2, follow_likers_per_photo = 3, randomize=True, sleep_delay=600, interact=False)
session.friend('user1', daysold=365, max_pic = 100, sleep_delay=600, interact=False)
friend_by_list(friendlist=['samantha3', 'larry_ok'], times=1, sleep_delay=600, interact=False)
unfriend_by_list(friendlist=['samantha3', 'larry_ok'], sleep_delay=6)
unfriend_by_urllist(urllist=["facebook.com/profile.php?id=100023983575804&fref=pb&hc_location=friends_tab", "https://www.facebook.com/profile.php?id=100021936281017&fref=pb&hc_location=friends_tab"])
If you notice that one or more of the above functionalities are not working as expected - e.g. you have specified:
session.set_do_follow(enabled=True, percentage=10, times=2)
Confirm all the friends requests recieved.
session.confirm_friends()
session.add_members_of_group(group_id="941808466025179")
From friends suggested by facebook add top few
session.add_suggested_friends()
If you're having issues with the "we detected an unusual login attempt" message, you can bypass it setting FacebookPy in this way:
session = FacebookPy(username=facebook_username, password=facebook_password, bypass_suspicious_attempt=True)
session.invite_friends_to_page(friendslist=['samantha3', 'larry_ok'])
It searches for pages with a term , then visits each of those pages and adds the likers of those pages
session.add_likers_from_term(search_term = "fantasy")
session.withdraw_outgoing_friends_requests()
session.get_recent_friends()
- modify
quickstart.py
according to your requirements python quickstart.py -u <myusername> -p <mypssword> -ui <my_userid>
*/10 * * * * bash /path/to/FacebookPy/run_facebookpy_only_once_for_mac.sh /path/to/FacebookPy/quickstart.py $USERNAME $PASSWORD $USERID
Check out this short guide on how to start contributing!.