I play with the Facebook Graph API and I have one problem - I cannot find a way to post ornew lines to the wall using HTML code . How can I do that? Here is my code
<?php
include_once 'lib/facebook.php';
define("FACEBOOK_APP_ID", '10126');
define("FACEBOOK_API_KEY", '064ca1988b');
define("FACEBOOK_SECRET_KEY", '9afdf92114');
define("FACEBOOK_CANVAS_URL", 'http://apps.facebook.com/my_canv_app/');
if (isset($_GET['code'])){
header("Location: " . FACEBOOK_CANVAS_URL);
exit;
}
$facebook = new Facebook(array('appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_SECRET_KEY));
$user = $facebook->getUser();
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => 'email,publish_stream,user_birthday,user_location,user_about_me,user_hometown'
)
);
if (!$user) {
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
exit;
}
try {
$uid = $facebook->getUser();
$me = $facebook->api('/me');
$statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> 'Trying to make new line here \n <br /> Neither works', 'cb' => ''));
} catch (FacebookApiException $e) {
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
}
?>
how could i do that?
source
share