PHP to post on a Facebook page

Hi, I’ve modified the Mini Bot Class, I’ve fixed the Facebook status update and I’ve implemented the function to post…

Luglio 28, 2010

Hi, I’ve modified the Mini Bot Class, I’ve fixed the Facebook status update and I’ve implemented the function to post on the wall of a facebook page: suppose you have a page of a brand, and you need to update it regularly with a cron job… Very, very usefull, isn’t it?

Nothing more to say. Just download the class from Mini Bot Class page and search for setFacebookStatus method and postToFacebookPage method.

Author

PHP expert. Wordpress plugin and theme developer. Father, Maker, Arduino and ESP8266 enthusiast.

Comments on “PHP to post on a Facebook page”

3 thoughts

  1. TI ha detto:

    Many thanks, looking like such a simple and effective solution.

    My example use:
    define (‘FACEBOOK_EMAIL_LOGIN’, ‘xxxxx’);
    define (‘FACEBOOK_PASSWORD’, ‘yyyyy’);

    define (‘FACEBOOK_DEBUG’, false);

    require_once ‘includes / minibots.class.php’;
    $ M = new Minibots ();

    if (isset ($ _GET [‘status’])) (
    $ M-> setFacebookStatus ($ _GET [‘status’], FACEBOOK_EMAIL_LOGIN, FACEBOOK_PASSWORD, FACEBOOK_DEBUG);
    )

    if (isset ($ _GET [‘post’])) (
    $ M-> postToFacebookPage ($ _GET [‘post’], ‘wall.php’ FACEBOOK_EMAIL_LOGIN, FACEBOOK_PASSWORD, FACEBOOK_DEBUG);
    )

  2. David ha detto:

    Howdy,

    Nice work, I like it.

    A couple of points. The Facebook Page status update is currently marred by the fact that the Facebook mobile site seems to (incorrectly?) post messages to your own wall, not the page. The action in the form is always /home.php rather than the page URL.
    It may be further complicated by the different permissions – an owner, vs someone who just ‘likes’ a page.

    Also, you’re using cookies but you’re not actually saving/reusing them – curl only sets cookies once you curl_close($ch)

    I’ll let you know when I’ve found a fix for the Facebook Page posting.

  3. sancora ha detto:

    not work….

Comments are closed

Recommended

PHP bot to get wikipedia definitions

Wikipedia, the collaborative and multilingual encyclopedia project, has a lot of usefull terms defined in its database, you can find…

Agosto 29, 2010

PHP curl bot to update Facebook status

I’ve found this great mini bot from Alste blog, and I’ve decided to add it to the mini bot class.…

Marzo 1, 2010

How to read facebook likes count from PHP

When you add facebook like button to your site, probably, you also want to save the number of likes of…

Ottobre 8, 2012

How to change twitter status with php and curl without oAuth

Twitter api authentication Since the 31 of august 2010, twitter made its API more secure, stopping basic authentication calls. So,…

Settembre 9, 2010

Social buttons: the fastest way for WordPress, without plugins

NOTE: the code in this post is written for WordPress but you can easily translate it in any language. You’re here…

Settembre 15, 2015

VK Social metrics, Top Stories plugin now with support for Vkontakte

VK SOCIAL METRICS VK.COM, also known as Vkontakte, is an important russian social network, which has over 270 million users.…

Novembre 19, 2014