Facebook API:使用多行消息发布到墙上
我正在使用 Post API 在用户墙上发帖。我希望发布的消息有换行符和链接。例如 -
屏幕截图 http://dl.dropbox.com/u/5154158/shot.png
第 1 行(Sid 是...)是 Post#title。
第 2 行(Venmo 是..)是 Post#description
第 3 行和第 4 行(查看更多,如果您)看起来是 Post#message。它是一个链接,并且有一个换行符。
我想实现第 3 行。文档说 Post#message 是一个 JSON 字符串,到目前为止我已经尝试给它 HTML(标签被剥离)、编码标签(标签被打印而不是实际应用)-似乎没有任何效果。
不知道该怎么做?有人有想法吗?
I'm posting to a User's wall using the Post API. I want the message which gets posted to have line breaks and links. Eg -
screenshot http://dl.dropbox.com/u/5154158/shot.png
Line 1 (Sid is ...) is Post#title.
Line 2 (Venmo is.. ) is Post#description
Line 3 and 4 (See more and If you) look to be Post#message. Its a link and there is a line break.
I want to achieve line 3. The documentation says Post#message is a JSON string, so far I've tried giving it HTML (tags get stripped), encoded tags( tags get printed instead of actually applied) - nothing seems to be working.
Not sure how to go about this ? Ideas anyone ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您至少可以通过以下方式做一些“类似”的事情:
1)将链接目标作为“链接”参数传递,并将“查看更多”作为标题传递。
2) 传递一个 actions 参数,如下所示:
{"name": "see more", "link": "http://mylinktarget.foo"}
You can at least do something "similar" this ways:
1) Pass your link target as "link" parameter and "see more" as caption.
2) pass an actions parameter like this:
{"name": "see more", "link": "http://mylinktarget.foo"}
换行符不起作用,但使用标签可以。
Line breaks do not work but using tags does.
Facebook API 似乎支持换行符 ASCII 代码 10。
The Facebook API appears to honor ASCII Code 10 for newlines.
%0A 用于换行。我已经和邮递员测试过。
%0A works for line break. I have tested with postman.