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

КОМЕНТАРІ • 150

  • @ankurwalia9894
    @ankurwalia9894 2 роки тому +4

    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.

  • @MohamedAhmed-rf5bk
    @MohamedAhmed-rf5bk Рік тому

    Man she is so good at explaining. I could watch her teach for hours. Thank you!

  • @Voltaic314
    @Voltaic314 10 місяців тому

    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!

    • @SkoloOnline
      @SkoloOnline  9 місяців тому

      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.

  • @DevonDassaw
    @DevonDassaw Рік тому +1

    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. :)

    • @SkoloOnline
      @SkoloOnline  Рік тому +1

      Thanks

    • @stephenadelakun
      @stephenadelakun Рік тому +1

      You spoke my mind on the voice and accent thing. She is good. And another thing: I downloaded the vid too.

    • @DevonDassaw
      @DevonDassaw Рік тому

      @@stephenadelakun great minds think alike

  • @stephenadelakun
    @stephenadelakun Рік тому

    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.

  • @vensing-main9712
    @vensing-main9712 Рік тому +2

    This video deserves millions of view.

    • @SkoloOnline
      @SkoloOnline  Рік тому

      Thank you

    • @stephenadelakun
      @stephenadelakun Рік тому

      You are right. I have not found a clearer tut on this subject. She(guessing based on the voice) is a good teacher.

  • @mikemolgano1512
    @mikemolgano1512 Рік тому +1

    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.

    • @SkoloOnline
      @SkoloOnline  Рік тому +1

      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.

    • @mikemolgano1512
      @mikemolgano1512 Рік тому +1

      @@SkoloOnline I am posting to pages of other accounts I have been given administration rights. I'm not the actual owner.

  • @ratulhasan7136
    @ratulhasan7136 Рік тому

    this is the best tutorial. thanks (I was honestly scared of graph API)

  • @dezinhtang
    @dezinhtang 3 місяці тому

    Copilot brings me here 🎉 and subscribed

  • @davis0166
    @davis0166 3 роки тому +1

    I just bumped with your channel, nice video! keep up the neat work!

  • @oldtownlife
    @oldtownlife 4 дні тому

    What are the local real estate supply, demand and price trends in Boquete?

  • @user-si2uz1kl8o
    @user-si2uz1kl8o 9 місяців тому

    Really,so much helpful❤❤❤❤😊😊😊😊

  • @PerksByPearl
    @PerksByPearl 3 роки тому +2

    Worth the watch

  • @EvidenceSello
    @EvidenceSello 3 роки тому +1

    Notification squad!!! Another automation video!! Hooray!!!

  • @diogosilva3152
    @diogosilva3152 3 роки тому +2

    incredible video! Just what I was looking for! Thanks

  • @theanonymous6198
    @theanonymous6198 3 роки тому +2

    thanks for this grateful explanation

  • @tarapanton4119
    @tarapanton4119 6 місяців тому +1

    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?

    • @SkoloOnline
      @SkoloOnline  5 місяців тому

      You need all the permissions

  • @lorsothy6263
    @lorsothy6263 Рік тому

    Thanks you it's contains all I want to know

  • @JefArtist
    @JefArtist 3 місяці тому +1

    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?

    • @dragon3602010
      @dragon3602010 2 місяці тому +1

      Me too, did you find why? Thanks

    • @JefArtist
      @JefArtist 2 місяці тому

      @@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.

  • @v.m.4453
    @v.m.4453 11 місяців тому

    God bless you

  • @WonderRob
    @WonderRob 3 роки тому +2

    Nice! Can you do a video about how a specific python script is being initiated/triggered when a Google sheet is updated/edited?

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      How would the python script know there has been an update in a google sheet?

    • @SunnySideDown916
      @SunnySideDown916 3 роки тому

      Use Google Sheets API SDK ;)

  • @Ganesan4510
    @Ganesan4510 Рік тому

    Awesome 🔥😇🙏
    Mam how to integrate all social account to one website

  • @TrueGeekWisdom
    @TrueGeekWisdom 3 роки тому +1

    This video was very helpful thanks!

    • @SkoloOnline
      @SkoloOnline  3 роки тому +1

      Glad it was helpful!

    • @TrueGeekWisdom
      @TrueGeekWisdom 3 роки тому

      @@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

  • @lerigogsadze5816
    @lerigogsadze5816 3 роки тому +1

    I have a valid access token but it throws that exception (#200) If posting to a group...

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      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

    • @lerigogsadze5816
      @lerigogsadze5816 3 роки тому

      Thanks, it was permission issue :)

    • @elierpilafarinas2113
      @elierpilafarinas2113 2 роки тому

      @@lerigogsadze5816 on a page or an group?? What kind of permission it's needed? Thanks.

  • @coralbrillante7808
    @coralbrillante7808 3 роки тому

    So amazing video, you explained very good, thank you !

  • @laurenjay-wo9hk
    @laurenjay-wo9hk 2 місяці тому

    how can i get the posts and comments from public pages and groups using facebook Graph API

  • @ronwest8452
    @ronwest8452 2 роки тому +1

    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 ;)

    • @SkoloOnline
      @SkoloOnline  2 роки тому

      Yes it needs to be entered as a string inside ''

  • @sindygoro3800
    @sindygoro3800 3 роки тому +1

    *KLAPTEC* òn instagram just made me proud, thank you so much sir..

  • @aleksandrnekhayenko9588
    @aleksandrnekhayenko9588 3 роки тому +1

    Please, give me examlpe of Step 2. Send a Private Message. I get error: param recipient must be non-empty

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      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

  • @lifeisgood-wz5py
    @lifeisgood-wz5py Рік тому +1

    But posts done with this method are visible to developer only?

    • @mohammedhichemmoulgada9793
      @mohammedhichemmoulgada9793 Рік тому

      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..

    • @SkoloOnline
      @SkoloOnline  Рік тому +1

      You need to get your app approved . . . .

  • @yasirkhan1278
    @yasirkhan1278 2 роки тому

    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.

    • @SkoloOnline
      @SkoloOnline  2 роки тому

      Check the docs, I am not sure specifically what you need.

  • @nochannel3005
    @nochannel3005 Рік тому

    Superb video!

  • @SunnySideDown916
    @SunnySideDown916 3 роки тому

    Awesome explanations and video! Subbed! Question: Why not use the Python FB SDK?

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      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.

  • @benmaoz
    @benmaoz Рік тому

    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.

    • @SkoloOnline
      @SkoloOnline  Рік тому

      I cant dive in to individual code, all I can say is go through the steps again and see what you missed

    • @benmaoz
      @benmaoz Рік тому

      @@SkoloOnline As far as I understand. The api can’t work without verifying the account as verified business account

  • @yeralexey
    @yeralexey 2 роки тому

    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

    • @SkoloOnline
      @SkoloOnline  Рік тому

      Not sure, I cant solve specific problems, just check the code again and google the error also

  • @harshmagiya9389
    @harshmagiya9389 2 роки тому

    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?

  • @adityarajgor6763
    @adityarajgor6763 2 роки тому

    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

  • @xeefar9243
    @xeefar9243 2 роки тому

    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 :)

    • @SkoloOnline
      @SkoloOnline  2 роки тому +1

      No, you need to host the photo on the internet

  • @khunspeech9021
    @khunspeech9021 8 місяців тому

    @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?

    • @khunspeech9021
      @khunspeech9021 8 місяців тому

      i can def buy you a beer, if you can help me with this!

    • @SkoloOnline
      @SkoloOnline  7 місяців тому

      I am sure its in the documentation somewhere

    • @khunspeech9021
      @khunspeech9021 7 місяців тому

      Couldnt find it

  • @user-vf7pc4tn9z
    @user-vf7pc4tn9z Рік тому

    Hello, i can'y fiexed (#200) If posting to a group, requires app being installed in the group) can you make a new video?

  • @zayneavril6875
    @zayneavril6875 2 роки тому

    What is the careers portal that you have created?

  • @georgelza
    @georgelza 2 роки тому

    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

    • @SkoloOnline
      @SkoloOnline  2 роки тому +1

      I dont have a working example no, but maybe i will do such a tutorial in future

    • @georgelza
      @georgelza 2 роки тому

      @@SkoloOnline would appreciate that.

  • @eduai-1
    @eduai-1 2 роки тому

    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?

    • @SkoloOnline
      @SkoloOnline  2 роки тому +1

      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.

    • @eduai-1
      @eduai-1 2 роки тому

      @@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?

    • @saumyarr8
      @saumyarr8 5 місяців тому

      @@eduai-1 did you get any answer oh how to automat4e for other users?

    • @eduai-1
      @eduai-1 5 місяців тому

      @@saumyarr8 I used selenium instead of api

  • @jagmohan9783
    @jagmohan9783 3 роки тому

    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.

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      Yes you can! Look through the Groups API in the documentation

  • @bogdan7782
    @bogdan7782 2 роки тому

    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?

  • @WiziwigeAgario
    @WiziwigeAgario 2 роки тому

    thank you !!

  • @olegchubukov
    @olegchubukov 3 роки тому

    Hi! Great video! Do you know how to set a background color for a text post/feed?

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      Can you put the text in an image and post that?

  • @ccn4709
    @ccn4709 3 роки тому +1

    Can we extract public post data through it

    • @SkoloOnline
      @SkoloOnline  3 роки тому +1

      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

    • @ccn4709
      @ccn4709 3 роки тому

      @@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

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      @@ccn4709 There are web scrapping techniques, but I dont teach that on this channel

    • @ccn4709
      @ccn4709 3 роки тому

      @@SkoloOnline yes I know the techniques but on FB for the first I stucked .

  • @TTT-ob2wc
    @TTT-ob2wc 3 роки тому

    Please make video to share articles on your personal page using php

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      We are mostly a python channel, php is not my strong point

  • @mohammedizedinmohammed7888
    @mohammedizedinmohammed7888 Рік тому

    why this is not working on my fb account🤔 is this only work for the pages.

    • @SkoloOnline
      @SkoloOnline  11 місяців тому

      That is how the API works, only for pages

  • @bash9608
    @bash9608 2 роки тому

    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.

    • @SkoloOnline
      @SkoloOnline  2 роки тому +1

      Will note it for a future video

  • @lbc5201
    @lbc5201 3 роки тому

    Hi, if I post only a link to a page using this method, does it show its preview on the post?

  • @amjadattouni2241
    @amjadattouni2241 3 роки тому

    How can i make python collect data from a text file.. so i can automate posting multiple posts?

    • @SkoloOnline
      @SkoloOnline  3 роки тому +1

      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.

    • @amjadattouni2241
      @amjadattouni2241 3 роки тому

      @@SkoloOnline thank you

  • @vensing-main9712
    @vensing-main9712 Рік тому

    Is there any way to write python script for posting Reels video on facebook page ?

    • @SkoloOnline
      @SkoloOnline  Рік тому

      Yes, there is. The documentation can show you how

  • @ILsupereroe67
    @ILsupereroe67 3 роки тому

    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"}}

    • @SkoloOnline
      @SkoloOnline  3 роки тому +1

      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

  • @copdatchoppa
    @copdatchoppa 2 роки тому

    Is it possible to post on your profile instead of a page?

    • @SkoloOnline
      @SkoloOnline  2 роки тому

      No, facebook does not allow that

  • @sibghataziz6981
    @sibghataziz6981 3 роки тому

    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??

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      Probably using characters that cannot be decoded - remove that character or encode using utf-8

    • @sibghataziz6981
      @sibghataziz6981 3 роки тому

      Mam its showing this error for access token

  • @CanadaOtter
    @CanadaOtter 3 роки тому

    Can you get a target user email using graph api?

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      Yes, you can - but you need to get your app approved first for facebook login

  • @Dave.Wattz100
    @Dave.Wattz100 2 роки тому

    Can you somehow upload multiple images combined with a text ?

  • @MarketingExperts1
    @MarketingExperts1 3 роки тому

    you can use #JarveePro to automate your facebook

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      Well there are many paid automation tools out there - Later, Hootsuite etc . . . . this is an alternative for people who want to code

  • @IndianMitron
    @IndianMitron 3 роки тому

    Can I post videos using this?

    • @SkoloOnline
      @SkoloOnline  3 роки тому

      Its a different endpoint for videos - but its possible to post videos with GraphAPI - just check the documentation for correct endpoint

  • @RIT_Edition
    @RIT_Edition Рік тому

    Source code?

  • @elierpilafarinas2113
    @elierpilafarinas2113 2 роки тому

    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.