Facebook API:使用多行消息发布到墙上

发布于 2024-11-11 18:07:25 字数 553 浏览 3 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

☆獨立☆ 2024-11-18 18:07:25

您至少可以通过以下方式做一些“类似”的事情:

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"}

冷了相思 2024-11-18 18:07:25

换行符不起作用,但使用标签可以。

{"description":"<center>line 1</center><center>line 2</center>"}

Line breaks do not work but using tags does.

{"description":"<center>line 1</center><center>line 2</center>"}
瞎闹 2024-11-18 18:07:25

Facebook API 似乎支持换行符 ASCII 代码 10。

The Facebook API appears to honor ASCII Code 10 for newlines.

执笔绘流年 2024-11-18 18:07:25

%0A 用于换行。我已经和邮递员测试过。

%0A works for line break. I have tested with postman.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文