Jump to content

Facebook status update API


ts2000abc

Recommended Posts

Hello,

 

So, I'm trying to create my first Facebook application with PHP.

 

Basic ideas for my application:

My website includes feature called “tip of the week"  and i would like to create a code that automatically sends this “tip"  to my facebook page as well (as status update). I tried use crontab in my webserver for sending the data, but ran into problems...

 

PHP code that i tried is simple:

$api_key = '***';
$secret  = '***';

require('/facebook-platform/php/facebook.php');

$facebook = new Facebook($api_key, $secret);
$user = $facebook->require_login();

$output = “my status";
$result = $facebook->api_client->users_setStatus($output);

 

This works just fine when it's used with browser. But the require_login() part gives trouble when code is used with crontab (no login cookie/information).

 

So is there a way to send data to my application without login, or is there some other way to create status updates? Can I send the login information with the require_login() (for example)?

Link to comment
https://forums.phpfreaks.com/topic/185459-facebook-status-update-api/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.