Automate Facebook Page Posts with Python and Facebook Graph API
Вставка
- Опубліковано 8 вер 2024
- #python #facebook #graphapi
Automate Facebook Page Posts with Python and Facebook Graph API
😀 video stamps 👇🏾👇🏾 Use to Jump ahead the video 😀
Buy me a Beer
www.buymeacoff...
Get a Domain online from domains
www.domains.co...
Get a VPS, droplet from Digital Ocean
m.do.co/c/7d9a...
Facebook Developers page - where you create an app
developers.fac...
Facebook Developers Graph API Documentation
/ publishing
Install xvfb
zoomadmin.com/...
Python IMGKit Library
pypi.org/proje...
WKhtmltopdf page
wkhtmltopdf.or...
Install wkhtmltopdf on linux
computingforge...
Python scheduling library
pypi.org/proje...
How to install Screen on Ubuntu VPS
www.digitaloce...
---------------------------------------------------------------------------------------------------------------
Video Timestamps:
00:02:06 Intro to the lecture, facebook developer website
00:03:26 Intro to Facebook Graph API Documentation
00:05:32 How to create a Facebook Application and get your page access token
00:13:43 Use Postman to test the Facebook Graph API
00:20:32 Use Python to post to facebook page using Facebook Graph API
00:29:31 Publish a photo to Facebook page using python and Facebook Graph API
00:47:49 Get long life access tokens from Facebook Graph API to use in the python automation code
00:58:08 How to get a domain and create an A record pointing to your VPS to use to host images online
01:02:56 Install nginx and create a server block to serve our images over http
01:11:10 High level explanation of how we are going to create images on the fly for our facebook automated posts
01:14:56 Install imgkit and go through code for creating images with text that we will use on our facebook posting
01:34:57 Changing font type and font size for the output image, also explaining how we adjust variables to change appearance and font
01:39:28 Randomise the text that goes in to the facebook post and image
01:48:19 Create a schedule to run the facebook automation functions at specific times of the day
01:50:20 Run python script inside of screen (Ubuntu) so the script can run on auto continuously just updating your facebook.
---------------------------------------------------------------------------------------------------------------
Social Media Links
Follow our Google News Publication:
news.google.co...
Follow us on Facebook: / skolo-online-learning-...
Follow us on Twitter: / skolo_online
Follow us on Instagram: / skolo_online
Learn more on Skolo Online
skolo.online
---------------------------------------------------------------------------------------------------------
Get Professionals to Build your Web Application
tati.digital
---------------------------------------------------------------------------------------------------------
Video Tags
#facebookautomation #facebookbot #socialmediaautomation #pythonbot
The content is just superb. its the right amount of detail and context for beginner and intermediate. Thanks a ton, people like yo make our life simpler.
Thank you
Man she is so good at explaining. I could watch her teach for hours. Thank you!
.
Skolo, your tutorial was what kick started my coding career. I challenged myself to learn Python programming because I wanted to make a funny automated meme page on FB using Python. I followed your tutorial and I was able to do it. Then I had another project idea and did that, then I had another, and another, one thing led to another and now I'm applying for full on internships in software development. Sometimes all it takes is the right domino to be set up. You enabled that for me, so I thank you for that!
Where are you based? if you are in Joburg, get in touch - I am always looking to bring in new interns. Love this story and people who can learn on their own, given the tools.
I'm not going to lie, I stayed in part because of the voice and accent. I'm downloading the video so I can watch and rewatch. Before I forget, let me subscribe. :)
Thanks
You spoke my mind on the voice and accent thing. She is good. And another thing: I downloaded the vid too.
@@stephenadelakun great minds think alike
This tutorial is excellent. It gave me all I wanted to learn on Facebook Graph APi. I followed through even though I am not doing Python, but PHP.
ok
This video deserves millions of view.
Thank you
You are right. I have not found a clearer tut on this subject. She(guessing based on the voice) is a good teacher.
Love the video; it provides an instructional tutorial easy to understand and apply. I could use some help... I created an Excel macro and Python script that programmatically writes posts to several pages I administer. The posts successfully publish, but even though they show as being public, I am the only one who can see them. I believe this is because the apps I had to create in Meta to establish the API are in “In development” mode. I’ve tried every way I could find to reach out for help from FB to no avail. I’ve tried submitting a request for app review but am stopped because of not providing a URL, including one for private policy. I do not make use of URLs; everything runs on my local machine/desktop.
Facebook and their requirements are sometimes so stupid. You dont need an app review to publish posts to your own page -- even their docs say so. I dont know why you are the only one who sees them . . . that just makes no sense.
@@SkoloOnline I am posting to pages of other accounts I have been given administration rights. I'm not the actual owner.
this is the best tutorial. thanks (I was honestly scared of graph API)
Glad it helped!
Copilot brings me here 🎉 and subscribed
I just bumped with your channel, nice video! keep up the neat work!
Awesome! Thank you!
What are the local real estate supply, demand and price trends in Boquete?
Really,so much helpful❤❤❤❤😊😊😊😊
Glad it was helpful!
Worth the watch
Thank you
Notification squad!!! Another automation video!! Hooray!!!
First one here for sure
incredible video! Just what I was looking for! Thanks
Glad it was helpful!
thanks for this grateful explanation
Glad it was helpful!
I am struggling to generate my page access token, I see on your example you have public_profile under permissions, I don't have that. Is that an issue?
You need all the permissions
Thanks you it's contains all I want to know
sure
I have a big problem, when I publish a post with the Facebook graph api it is published, but only the administrators and I can see it, but not the clients, why?
Me too, did you find why? Thanks
@@dragon3602010 The reason is because the publications are being made with the app in test version, you need to have the app approved for use.
God bless you
Thank you
Nice! Can you do a video about how a specific python script is being initiated/triggered when a Google sheet is updated/edited?
How would the python script know there has been an update in a google sheet?
Use Google Sheets API SDK ;)
Awesome 🔥😇🙏
Mam how to integrate all social account to one website
All social accounts?
This video was very helpful thanks!
Glad it was helpful!
@@SkoloOnline Been using it for about 1 week now. The only extra thing I had to do was swap the token for a permanent token otherwise it kept expiring on me
I have a valid access token but it throws that exception (#200) If posting to a group...
Not sure what the problem could be there, all the steps are there in the video, just trace back - google the error, you will find a solution
Thanks, it was permission issue :)
@@lerigogsadze5816 on a page or an group?? What kind of permission it's needed? Thanks.
So amazing video, you explained very good, thank you !
You're very welcome!
how can i get the posts and comments from public pages and groups using facebook Graph API
I would just like to add that in the config file the access token variable needs to be entered as a string ' ' total noob advice ;)
Yes it needs to be entered as a string inside ''
*KLAPTEC* òn instagram just made me proud, thank you so much sir..
Glad to hear it!
Please, give me examlpe of Step 2. Send a Private Message. I get error: param recipient must be non-empty
Its hard to comment without specifics of the code and more detail, i recommend just going through the video in detail to see what you could have missed - everything is covered in the video
But posts done with this method are visible to developer only?
I have the same issue, the posts are showing only to me, when I am logged in. If you find a solution please share it with the rest of us. Thanks..
You need to get your app approved . . . .
Hey there, so far tutorial is awesome, Actually my question is:
I have a website and facebook page too, What I want is to have all posts with likes shares comments on my website. It can be done using webhook and developer api of facebook. But I do not know about the procedure kindly guide me.
Check the docs, I am not sure specifically what you need.
Superb video!
Thank you very much!
Awesome explanations and video! Subbed! Question: Why not use the Python FB SDK?
Good catch, its a choice and this way people can follow even if not coding in python because everything is interpreted in curl and how the FB documentation is written.
HI, great video. not sure why but when I'm trying to get the FB page access token it connected to it but not showing the page name in the option after that.
I cant dive in to individual code, all I can say is go through the steps again and see what you missed
@@SkoloOnline As far as I understand. The api can’t work without verifying the account as verified business account
hi! Cant get, why i recieve an error when post to instagram or facebook caption, that includes hastags? Any mention of symb oll "#" gives me a 'message': '(#100) 0 does not resolve to a valid user ID' error , please help
Not sure, I cant solve specific problems, just check the code again and google the error also
Heyy
Thank you soo much for the video
I had a issue with the page posting thing
So i am able to post on the page via api but only the owner of the page is able to see it
And hen i post from facebook itself on this page .. that's visible to everyone
Where can I be going wrong?
Thank you
10:48 I don't wanna ignore that 🥺Can you please make a video how to do that submission, I am literally stucked on making my app live
Noted
Hello :) thx for your video, just a question : Is that possible to publish a photo which is not on internet ? I mean, Is there a way that replace the url in the payload by the local path ?
thank you :)
No, you need to host the photo on the internet
@skolo , thks for the info.. I am able to send a post to my private fb group.. But I neeed to know how to disable comments on this same post? Do you know how to do this?
i can def buy you a beer, if you can help me with this!
I am sure its in the documentation somewhere
Couldnt find it
Hello, i can'y fiexed (#200) If posting to a group, requires app being installed in the group) can you make a new video?
.
What is the careers portal that you have created?
website
wonder if you can assist. been scanning through examples and google etc...
I'm trying to upload a photo taken by a Python3 script daily at 05:30.
I'd like to upload the photo to a pre created Album on my FB page (going to include the predicted weather for the day).
From the various examples I've seen no where can I see how to "tag" the photo to go into a album.
Any chance you can point me to a rough working example.
Thanks
G
I dont have a working example no, but maybe i will do such a tutorial in future
@@SkoloOnline would appreciate that.
Hey do we need to change the page access token that is create a new every time it expires? If so than show to automatically get the new access token so that the user don't need to open graph API explorer everytime they want to automate with the script?
There is a part in the tutorial where I show you how to get a long-life page token which does not expire, I am still using one from last year.
@@SkoloOnline okay, it looks good. Bht I still have an question. If I make a app for the users to automate their facebook, then do they need their individual developers account and app to get their respective token. Or is there a way in which if they allow my app to use the data of the users, they can do automation without generating their developer account?
@@eduai-1 did you get any answer oh how to automat4e for other users?
@@saumyarr8 I used selenium instead of api
Could we post on a FB group as Member using Graph API? I have tried it but I am not able to post on any group. Any help would be appreciated.
Yes you can! Look through the Groups API in the documentation
Would this be possible with facebook link posts? You know, the ones where you get the preview image to click on to lead you to that URL?
Yes
thank you !!
Welcome
Hi! Great video! Do you know how to set a background color for a text post/feed?
Can you put the text in an image and post that?
Can we extract public post data through it
Yes, you can. In order to do that, you need to add login permission access. Then you need to get your app approved, it takes sometime - you must have a website with a privacy policy that states how you are going to use the data. Users have to give you access as well - you will build it like how hootsuite and later works . . . . I will do a video on it in the near future, check the notifications
@@SkoloOnline no I meant to say that how to scrap data from any public post without login. Because FB's response is encoded.
Here I have used bs64 to decode because mostly data is encoded in that format but it's not working.
If you know the encoding then please mention
@@ccn4709 There are web scrapping techniques, but I dont teach that on this channel
@@SkoloOnline yes I know the techniques but on FB for the first I stucked .
Please make video to share articles on your personal page using php
We are mostly a python channel, php is not my strong point
why this is not working on my fb account🤔 is this only work for the pages.
That is how the API works, only for pages
Could you make a tutorial on how to upload "resumable" videos to a page with python and Graph API, please? I have tried but it returns an error.
Will note it for a future video
Hi, if I post only a link to a page using this method, does it show its preview on the post?
yes
How can i make python collect data from a text file.. so i can automate posting multiple posts?
Here is a video we did on extracting data from a pdf document and web-scrapping (ua-cam.com/video/hYrgPYshC5I/v-deo.html) - you might find something useful in here. You basically just want to read the file and pull out the line items - one by one, read them and do something with them.
@@SkoloOnline thank you
Is there any way to write python script for posting Reels video on facebook page ?
Yes, there is. The documentation can show you how
55:48 I get {"error":{"message":"Error validating application. Cannot get application info due to a system error.","type":"OAuthException","code":101,"fbtrace_id":"AbzivNbY45rUnNO7JxI4oB3"}}
It could be your app ID that is wrong, or access token. This error means, facebook cannot verify you. Go through the tut again and check what you could have missed. Remember, she short token also only lasts for an hour, try also on the facebook developer page to run the command first - it has better troubleshooting
Is it possible to post on your profile instead of a page?
No, facebook does not allow that
mam can you help me with and error,
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
please??
Probably using characters that cannot be decoded - remove that character or encode using utf-8
Mam its showing this error for access token
Can you get a target user email using graph api?
Yes, you can - but you need to get your app approved first for facebook login
Can you somehow upload multiple images combined with a text ?
Yes you can
you can use #JarveePro to automate your facebook
Well there are many paid automation tools out there - Later, Hootsuite etc . . . . this is an alternative for people who want to code
Can I post videos using this?
Its a different endpoint for videos - but its possible to post videos with GraphAPI - just check the documentation for correct endpoint
Source code?
On the video
Hi, thanks for such as an excellent tutorial. But I still having issues posting, I set pages_manage_posts Permission but I still having the same OnAuthException.
{"error":{"message":"(#200) If posting to a group, requires app being installed in the group, and \\
either 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","type":"OAuthException","code":200,"fbtrace_id":"AQTrmbRhs_6v_VkN80fp-Gk"}}
I am using v14.0 API.
Google it