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

Adding delete feature to my forum
Hello I am currently trying to add a delete feature to my forum. I believe I have everything built r

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

update the selected existing records of database
Hi frndz,
I am new to php and get stuck....

Edit.php > Update.php > Updatea

Do not allow posting of whitespace
Currently the script below works if the user does not type a name/message, but if i create a whitesp

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

how to timeout $doc = new DOMDocument()->load($url)
I am currently using this $doc->load($url) to fetch an rss feed.
If a feed takes long than

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want

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