为什么 facebook.feed.publishUserAction 会删除我的图像?
我正在 Rails 中使用 Facebooker 插件将用户操作发布到他们的新闻源,但未添加图像。
该调用(通过 Net::HTTP.post_form)如下所示:
Posting to http://api.facebook.com/restserver.php with
{:api_key=>"4f5ed28f76142adsfasdf029c98ad", :template_bundle_id=>"107345673712",
:template_data=>"{\"project\": \"testing\", \"images\":
[{\"src\":\"http://www.dezyne.net/news.jpg\",
\"href\":\"http://www.facebook.com/\"}]}",
:session_key=>"2.nvhdfsdfgimDZWSwQ__.86400.1245405600-100000007614297",
:method=>"facebook.feed.publishUserAction", :sig=>"ac0a7181b351b5fdgsdfge767a004314",
:call_id=>"1242343866.44512", :v=>"1.0"}
“Project”在发布到新闻源的文本中正常捕获。
I'm using the Facebooker plugin in Rails to publish a user action to their newsfeed, but the image isn't being added.
The call (via Net::HTTP.post_form) looks like this:
Posting to http://api.facebook.com/restserver.php with
{:api_key=>"4f5ed28f76142adsfasdf029c98ad", :template_bundle_id=>"107345673712",
:template_data=>"{\"project\": \"testing\", \"images\":
[{\"src\":\"http://www.dezyne.net/news.jpg\",
\"href\":\"http://www.facebook.com/\"}]}",
:session_key=>"2.nvhdfsdfgimDZWSwQ__.86400.1245405600-100000007614297",
:method=>"facebook.feed.publishUserAction", :sig=>"ac0a7181b351b5fdgsdfge767a004314",
:call_id=>"1242343866.44512", :v=>"1.0"}
'Project' is captured OK in the text that's posted to the newsfeed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个可能的问题是您在实际上传图像之前测试了此模板。 这将导致 Facebook 缓存一张空图像。 每次请求图像时,FB 都会使用其存储的缓存,而不是重新检索图像。
如果这是问题所在,解决方案是使用 API 函数 fbml.refreshImgSrc() 来使 Facebook 更新其缓存。 不幸的是,没有快速机制可以执行此操作,因为该 API 方法在测试控制台中或通过开发人员应用程序根本不可用,这意味着您需要编写一个脚本来刷新该图像的缓存。
如果这没有帮助,请回帖,我会看看是否想不出任何其他可能的问题。
One possible issue is that you tested this template before actually uploading the image. This would cause Facebook to have cached an empty image. Every time the image is requested, FB uses their stored cache rather than retrieving the image all over again.
If this is the problem, the solution is to use the API function fbml.refreshImgSrc() to cause Facebook to update their cache. Unfortunately there's no quick mechanism to do this as that API method is not available in the Test Console nor through the Developer app at all, meaning you will need to write a script just to refresh the cache of this image.
If this doesn't help, post back and I'll see if I can't think of any other possible problems.