How to put inside Facebook message feed "profile link" used API ?
For now I have prepared this code:
$request = $this->fb->post('/'.$this->pageId.'/feed', [
'message' => "
I'ves been testing my IQ! #facebook \n\t
#test #testt #testowy\n\t
http://www.example.com
",
'name' => 'Some title',
'caption' => 'some caption',
'link' => 'http://www.example.com',
'actions' => json_encode(array('name'=>'Some name','link'=>'http://www.example.com')),
'description' => 'Some description #example',
'picture' => 'http://www.example.com/image.jpg'
]);
published post view:
published post view (image)
It looks nice but I'd like change #facebook to link to profile link to look like this:
published post view after changes (image)
Some advice, how to make this?
Related
Something strange happens using the facebook feed, if I enter the destination URL in the format "app.facebook.com/..." the stream of public information correctly including the attached image, but if I change the link in the "www.facebook.com/page_name/APP_ID", no image appears into stream.
Code below:
$publishStream = $facebook->api("/$session/feed", 'post', array(
'message' => "Message",
'picture' => URL_APP,
'name' => 'Name',
'description'=> 'Description',
'link' => 'https://www.facebook.com/PageName?sk=app_1447229...',
)
);
So I'm creating posts to the facebook user's wall using Graph API
I'm referring to the 'caption' as stated here:
http://nocturnsoft.com/devblog/?p=906
when I specified the 'caption' option, the text in the caption would appear properly for profiles that uses the timeline, but for profile that use the old style, the caption would not appear...
Am I doing something wrong here or is this how it's supposed to be....If it is how it's supposed to be, how would I display text beneath the link for the Facebook post for non timeline profiles
btw: I'm using Facebook PHP SDK
In my apps the post data array looks like this and the caption (message) is present on both new and old profiles.
/* post to fb */
$post = array(
'access_token' => $fb_access_token,
'message' => 'THIS IS YOUR CAPTION HERE',
'link' => 'LINK TO YOUR SITE OR APP HERE',
'picture' => 'URL TO IMAGE HERE',
'name' => 'APP NAME HERE',
'description' => 'AWESOME DESCRIPTION ABOUT YOUR APP GOES RIGHT HERE!'
);
$res = $facebook->api('/me/feed', 'POST', $post);
Hope this helps. If so don't forget to say so! :)
T'm writing a Facebook canvas app, and I'm trying to post to the user's wall. this the code I'm using:
if ($user) {
$attachment = array('message' => 'This is message',
'name' => 'Name of the message',
'caption' => 'Caption of link',
'link' => 'http://www.example.com/about',
'description' => 'Great site!',
'picture' => 'http://lorempixum.com/100/100/',
'actions' => array(array('name' => 'Do Something!',
'link' => 'http://www.example.com'))
);
$result = $facebook->api('/me/feed/',
'post',
$attachment);
}
So I tested with 2 facebook accounts, and it posts to the wall but without the facebook dialog i'm always seeing. I would like the user to be warned that I'm gonna post on the wall, and allow him to cancel it.
How do I do that?
You need to use the JavaScript SDK, essentially the dialogs bit: http://developers.facebook.com/docs/reference/dialogs/feed/
I am adding functionality to post to a visitors Facebook wall.
I am using the following code:
$path_to_image = "http://projects.kleelof.com/boot_designer/image_interchange.php?c=" . $file_id;
$attachment = array('message' => 'this is my message',
'name' => 'The name of your company',
'caption' => "Caption of the Post",
'link' => $path_to_image,
'picture' => $path_to_image,
'description' => 'this is a description',
'access_token' => $facebook->getAccessToken()
);
//echo($path_to_image);
$result = $facebook->api('/me/feed/','post',$attachment);
The post appears on my wall, but not the image.
You can see the full process and post it makes by trying the app at: http://projects.kleelof.com/boot_designer - Then select either one of the 2 links.
take care,
lee
I think the path to the image needs to be and actual file system path, and the image will be read and uploaded along with the request for FB to process. Also, it needs to start with a # to actually upload it.
Im new at facebook app development and I am trying to make an automatic post on an event wall. I have read that include the id to post on a specific wall. I have tried that but it doesn't work.
I thought that maybe it would work with "to" (a specific targeted wall), but I don't know it's syntax...
can anyone help? or at least give an example of a post syntax with a "to" property included... plssss...
$attachment = array(
'message' => 'this is my message',
'name' => 'This is my demo Facebook application!',
'caption' => "Caption of the Post",
'link' => 'http://mylink.com',
'description' => 'this is a description',
'picture' => 'http://mysite.com/pic.gif',
'actions' => array(array('name' => 'Get Search',
'link' => 'http://www.google.com'))
);
$uid = ""; //friend id OR "me"
$result = $facebook->api('/'.$uid.'/feed/','post',$attachment);
http://developers.facebook.com/docs/reference/api/post/
NOTE: you should have the user publish_stream extended permission and you should have the SDK Lib loaded.
$attachment = array(
'message' => 'this is my message'
);
$eid = ""; //event id
$result = $facebook->api('/'.$eid.'/feed/','post',$attachment);
http://developers.facebook.com/docs/reference/api/event/ <-- event object documentation
or
https://api.facebook.com/method/stream.publish?message=<your_message>&target_id=<event_id>&access_token=<your_token>