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

Passing an array of values From VB6.0 to Oracle PL/SQL Function
Basically we are using VB6.0.

When we try to pass an array from VB6.0 to an Oracle PL/SQL

Dynamic Array using glob?
Is there an easier way to do this?

I am trying to get create a dyamic array based on files wi

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

SAP Logon Failed
I tried to login to SAP through MMC.

When i click start and give password.

it

Cant display mysql data
Hey all,

I am learning php and my first goal is to create a simple CMS. At the moment I am st

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

How to Create a Dynamic table
col1 col2 date1 date2 date3 date4..........
a b v1 v2 v3 v4

Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and gi

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