通过 URL 将内容添加到 Facebook 流
我有一个用户脚本(阅读:我在别人网站上的Javascript),允许用户分享他们的IMDb 与 Facebook 好友一起投票。我只是为 Facebook 共享页面生成一个 URL,其中包含特定情况所需的所有自定义信息,例如“某某给电影《阿甘正传》在 IMDb 上的评分为 9/10”,其中包含缩略图和电影的链接页面本身,并允许用户添加他们对电影本身的想法。
带有 Facebook 共享对话框的脚本 http://s3.amazonaws.com/uso_ss/10985 /large.png?1284850755
直到最近,我通过将所有参数传递给 http://www.facebook.com/connect/prompt_feed.php。昨天这个问题被打破了,Facebook 似乎正在弃用这种共享方法,转而使用他们的 Dialog 代码。 (所有官方 FB 文档现在都将 Prompt_feed.php 称为“旧”共享方式。)
我找到了一个临时解决方法 此处 只是将 display=touch 变量添加到prompt_feed 查询字符串中。 此网址暂时有效(请继续点击它!),但我担心它是一旦 Facebook 意识到这个漏洞仍然可用,他们就会立即堵住这个漏洞,而我将无法在 FB 上发布内容。
当前发布到 Facebook 的方法似乎是 1) 使用上面提到的 Dialog URL 和 2) 通过使用 FB.ui 的 Javascript 这两种方法似乎都需要Facebook 应用 ID 以及何时我为此目的注册了一个新的 FB 应用程序,并尝试使用它来创建一个 http://www.facebook .com/dialog/feed 请求时,我收到错误,因为我的应用不“拥有”它链接到的 IMDb 页面。关于如何实现我的未来目标有什么想法吗?
I have a userscript (read: my Javascript on someone else's site) that allows users to share their IMDb votes with their Facebook friends. 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.
script with Facebook share dialog 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. Yesterday this broke, and it appears that Facebook is deprecating this sharing method in favor of using their Dialog code. (All of the official FB docs now refer to prompt_feed.php as the "old" way of sharing.)
I found a temporary workaround here that just adds a display=touch variable to the prompt_feed query string. 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, and I'll be stuck without a way to post stuff to 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. Any ideas about how to accomplish my purposes going forward?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要“拥有”imdb 页面,您只需将画布 url 设置为 imdb 域。
to "own" the imdb page you just need to set the canvas url to the imdb domain.
您可以简单地使用此网址:
只需将上述网址中的
http://www.your-url-to-share.com
部分修改或更改为您想要的网页或文章的网址在 Facebook 上分享。you can simply use this url:
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.如果您使用 sharer.php 并想要文本加链接,请将 &t={text} 添加到 url。例如:
http://www.facebook.com/sharer.php?u=http://www.your-url-to-share.com&t=text-to-share
If you use the sharer.php and want text plus a link add the &t={text} to the url. For example:
http://www.facebook.com/sharer.php?u=http://www.your-url-to-share.com&t=text-to-share