简体   繁体   English

通过 URL 向 Facebook stream 添加一些内容

[英]Add something to Facebook stream via URL

I have a userscript (read: my Javascript on someone else's site) that allows users to share their IMDb votes with their Facebook friends.我有一个用户脚本(阅读:我在别人网站上的Javascript ),允许用户与他们的 Facebook 朋友分享他们的 IMDb 投票。 I just generate a URL for a Facebook share page with all of the custom information needed for the specific situation, something like "So and so gave the film Forrest Gump a rating of 9/10 on IMDb" with links to a thumbnail and the movie page itself, and allow the user to add their their thoughts on the movie itself.我只是为 Facebook 共享页面生成了一个 URL,其中包含特定情况所需的所有自定义信息,例如“某某给电影 Forrest Gump 在 IMDb 上的评分为 9/10”以及指向缩略图和电影的链接页面本身,并允许用户将他们的想法添加到电影本身。

script with Facebook share dialog http://s3.amazonaws.com/uso_ss/10985/large.png?1284850755带有 Facebook 共享对话框的脚本 http://s3.amazonaws.com/uso_ss/10985/large.png?1284850755

Until recently, I accomplished this by passing all of my parameters to http://www.facebook.com/connect/prompt_feed.php .直到最近,我通过将所有参数传递给http://www.facebook.com/connect/prompt_feed.php来实现这一点。 Yesterday this broke, and it appears that Facebook is deprecating this sharing method in favor of using their Dialog code .昨天这个问题发生了,似乎 Facebook 正在弃用这种共享方法,转而使用他们的Dialog 代码 (All of the official FB docs now refer to prompt_feed.php as the "old" way of sharing.) (所有官方 FB 文档现在都将 prompt_feed.php 称为“旧”共享方式。)

I found a temporary workaround here that just adds a display=touch variable to the prompt_feed query string.我在这里找到了一个临时解决方法,它只是将 display=touch 变量添加到 prompt_feed 查询字符串。 This URL is working for the time being (go ahead and click it,), but I fear that it's a loophole that Facebook will close as soon as they realize it's still available.这个 URL目前正在工作(继续点击它,),但我担心这是一个漏洞,Facebook 一旦意识到它仍然可用就会关闭。 and I'll be stuck without a way to post stuff to FB.而且我会被困在无法将内容发布到 FB 的情况下。

The current methods of posting to Facebook seem to be 1) using the Dialog URL mentioned above and 2) via Javascript using FB.ui Both of these methods appear to require a Facebook App ID, and when I registered a new FB app for this purpose and tried to use it to create a http://www.facebook.com/dialog/feed request, I got an error because my app doesn't "own" the IMDb page that it's linking to. The current methods of posting to Facebook seem to be 1) using the Dialog URL mentioned above and 2) via Javascript using FB.ui Both of these methods appear to require a Facebook App ID, and when I registered a new FB app for this purpose并尝试使用它来创建http://www.facebook.com/dialog/feed请求,我收到一个错误,因为我的应用程序不“拥有”它链接到的 IMDb 页面。 Any ideas about how to accomplish my purposes going forward?关于如何实现我的目标的任何想法?

to "own" the imdb page you just need to set the canvas url to the imdb domain.要“拥有” imdb 页面,您只需将 canvas url 设置为 imdb 域。

you can simply use this url:你可以简单地使用这个 url:

http://www.facebook.com/sharer.php?u=http://www.your-url-to-share.com

Just modify or change the http://www.your-url-to-share.com part in the above URL with url of the webpage or article that you want to share on the facebook feeds. Just modify or change the http://www.your-url-to-share.com part in the above URL with url of the webpage or article that you want to share on the facebook feeds.

If you use the sharer.php and want text plus a link add the &t={text} to the url.如果您使用 sharer.php 并想要文本和链接,请将 &t={text} 添加到 url。 For example: http://www.facebook.com/sharer.php?u=http://www.your-url-to-share.com&t=text-to-share例如: http://www.facebook.com/sharer.php?u=http://www.your-to-url-to-share.com&t=

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM