In this article, you will learn how to create a Facebook Bot to post automatically on groups using Facebook Graph API and Python Programming Language. By using this Facebook bot you can post automatically on every Facebook group which you have joined.
Features of Facebook Bot
- Get all of the Facebook group ids which you have joined
- Read post link with a hash tag and description from excel file
- Post every link (added in excel file) on all Facebook groups (post after 12 to 16 minutes)
- Get the random link from excel file and post on Facebook groups randomly (post after 12 to 16 minutes)
How to Create Facebook Bot to Post Automatically on Groups
Below are the steps to create a Facebook bot using python and Facebook graph API.
- Create and generate access tokens by using Facebook Graph API
- Make a JSON file (named "credentials.json") and use the above token to in that file by creating a python dictionary (key-value pair). The key will be "access_token" and the value should be the generated token.
- Create an excel file named "link_description.xlsx", the file contains three columns and the name of the columns must be like below.
- link
- tag
- description
- Each row of your excel file contains the post link, tag, and description. You can add as many rows as you want.
Create and generate access tokens by using Facebook Graph API
Make a JSON File "credentials.json"
{"access_token": "your access token goes here"}
Create an Excel File "link_description.xlsx"
Below is the code snippet of the Facebook bot to post automatically in Facebook groups after 12 to 16 minutes.
2 Comments
GraphAPIError: (#200) If posting to a group, requires app being installed in the group, and \
ReplyDeleteeither publish_to_groups permission with user token, or both pages_read_engagement \
and pages_manage_posts permission with page token; If posting to a page, \
requires both pages_read_engagement and pages_manage_posts as an admin with \
sufficient administrative permission
It doesn't work, that facebook app needs to be installed on that particular group to allow API posting on it
ReplyDelete