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

problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according t

How to grab certain words ??
I am working with this API

Returns JSON.
curl http://letsbetrends.com/api/current_trends

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

How to make URL loads only on login
On my page, when a user login he's redirects to user_home.php. I made it also to open the chat scree

Problem in OnClientClick and OnClick sync
Hi,Strange and irritating problem: I have below button declaration in markup of the aspx page:

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

having probem inserting data into db table
hi

i have a table with following columns in it
Code: candidate_id, degree, cgpa, institute

Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I canno

Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel

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