使用API​​发布链接不包括图片,标题或元描述PHP [英] Using API To Post Links Does Not Include Picture, Title or Meta Desc PHP

查看:94
本文介绍了使用API​​发布链接不包括图片,标题或元描述PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用API​​发布时,我会收到以下信息:

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);

参考如何将缩略图张贴到Facebook / links对象?它表示该项目将图片从页面本身

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

想法?

推荐答案

在数组中传递以下项目:

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"

这样可以消除任何依赖FB刮刀的网址,刮取并解析数据。

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

这篇关于使用API​​发布链接不包括图片,标题或元描述PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆