Facebook status update API


Posted on 16th Feb 2014 07:03 pm by admin

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:
Code: $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)?

No comments posted yet

Your Answer:

Login to answer
123 Like 42 Dislike
Previous forums Next forums
Other forums

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Error with login script
I am getting an error with my login script:

Error:
Code: Warning: Cannot modify header inf

Convert .fdf to .pdf
I currently have a web form that uploads the form data to an .fdf file and emails it.

However

Function
How can I make this function that once you click the link in the code it takes you to a new page wit

Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen24

Intrastat Report Config in ECC 6.0 - goods Movement in EU countries
Colleagues, need ur help to understand the changes require in ECC 6 standard Report configuration se

Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,

Its been a while, I know. Use to love coming here to answer peoples questions, but

PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing

finding key position of specified value in multi-dimensional array
Code: $openedfile = fopen($tfc_file4, "r");
$rc = 1;
while(!feof($openedfile))
{<

problem with php mysql query
Hi guy's...

I'm totally lost here..because don't have any idea how to make a query for grab r

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash