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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

keeps going back to index.html ???????
ok so i started making my site using mostly.html files now i have added a fair chunk of php. My inde

Checkbox info wont include in Mailto
Hey, im new to php.
Basically I have made a form to request which type of job(s) are needed, whic

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

Auto-populating dropdowns and multiple forms.
Here's what I have so far:

First drop down = select a state (works)
This populates the sec

Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
But w

Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the goin

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

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