Jul 28 2010

PHP to post on a Facebook page

Category: Php,Spiders & web botsGiulio Pons @ 4:18 pm

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.

Share

Related posts:

  1. PHP curl bot to update Facebook status
  2. PHP Web page to text function
  3. Posting to Facebook from website with Facebook Connect
  4. New version of Mini Bots PHP Class (v.1.4)
  5. PHP bot to get wikipedia definitions

Tags: , , , , , , , ,

4 Responses to “PHP to post on a Facebook page”

  1. TI says:

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

    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. Zfyeqzvz says:

    I work for a publishers kds nymphet %(((

  4. sancora says:

    not work….

Leave a Reply