Using API To Post Links Does Not Include Picture,

2019-04-14 05:07发布

When posting using the API i receive this:

https://www.facebook.com/weather.warnings/posts/329128793830700

notice how the Title, thumbnail and meta description are missing from the thing.

The following is the code i am using.

$allalert = array
(
'oauth_token' => 'not pasting this thanks :P',
'message' => "New $type for $where",
'link' => $url,
);
$sendalert = $facebook->api('/125291287567922/links/','POST',$allalert);

Referencing how does one post a thumbnail picture to a Facebook /links object? it says the item pulls the picture from the page itself

thoughts?

2条回答
劳资没心,怎么记你
2楼-- · 2019-04-14 05:11

You can do it by passing the following items in the array:

'name' => "post title",
'link' => "url to the page",
'message'=> "message",
'description' => "longer description",
'picture'=>"url of the picture",
'caption' => "Another bit of text"

This removes any reliance on the FB scraper to go out to the url and scrape and parse the data.

查看更多
欢心
3楼-- · 2019-04-14 05:34

You need to add the needed og tags to your page.

查看更多
登录 后发表回答