Facebook graph api 使用api在facebook上发布所需消息
我正试图通过facebook墙上的API发布一条消息。问题是,当我通过api发布时,与直接将链接粘贴为facebook状态时,它的显示方式有所不同。我不确定我是否做错了什么。请告知 作为一个例子,我想发布的链接是 我使用的代码类似于:Facebook graph api 使用api在facebook上发布所需消息,facebook-graph-api,restfb,Facebook Graph Api,Restfb,我正试图通过facebook墙上的API发布一条消息。问题是,当我通过api发布时,与直接将链接粘贴为facebook状态时,它的显示方式有所不同。我不确定我是否做错了什么。请告知 作为一个例子,我想发布的链接是 我使用的代码类似于: FacebookType publishMessageResponse = facebookClient.publish("me/feed", FacebookType.class, Parameter.wi
FacebookType publishMessageResponse = facebookClient.publish("me/feed", FacebookType.class,
Parameter.with("name", "Click here to Register as a Blood Donor"),
Parameter.with("picture", "http://commondatastorage.googleapis.com/blood/2415012_26-May-2012"),
Parameter.with("link", "http://links.sakshum.org/RegisterBloodDonor"),
Parameter.with("description", "Sakshum is a not for profit organization working in the field of child education and building an effective blood donor pool."));
因为当你直接粘贴时,Facebook会试图推断meta-OG标签 有关详细信息,请参阅调试器 推断属性:“og:url”属性应显式 提供,即使可以从其他标记推断出值 推断属性:应明确提供'og:title'属性,即使 如果可以从其他标记推断值 推断属性:应显式提供“og:description”属性,即使 可以从其他标记推断值。。。等 在url的
部分设置元标记,就不必设置它了。
在您的
有关
feed
的更多信息,请参见在这种情况下,我应该设置什么作为元标记来显示链接的内容?@Vik您的html页面有一个名为“oh ok”的部分,所以您的意思是在创建页面时我设置了这些内容?@Vik如果您拥有该页面,是的,如果没有,您必须像上面那样使用提要
method@Vik您在问题中编写了创建链接名称、显示图片和提供描述的代码。您不能通过提要
强制提供元信息,添加元信息的唯一方法是将其实际添加到页面的html中。
<meta property="og:url" content="http://commondatastorage.googleapis.com/blood/2415012_26-May-2012">
<meta property="og:title" content="Click here to Register as a Blood Donor">
<meta property="og:description" content="Sakshum is a not for profit organization working in the field of child education and building an effective blood donor pool.">
<meta property="og:image" content="http://YOURURL.COM/LINKTOIMG.jpg">