开发者

Facebook Comments Widget - Access via Graph "Unknown identifier"

My site is using the Facebook comments box plugin. I can开发者_如何学运维 access the comments using the graph api for my iOS app by calling:

https://graph.facebook.com/comments?ids={url}

However, if the url referenced above isn't visited at least once in a browser I'll get the error:

{
  error: {
    type: "Exception",
    message: "Unknown identifier, ",
  }
}

It makes sense that the url hasn't been registered yet via the plugin. However, I might be accessing these urls in my iOS app before anyone visits them on the web. Does anyone know of a graph api call that will register the url with Facebook? If my situation were read only I would simply say there are no comments but I have the same problem when trying to post a comment.


You can programmatically scrape a particular page containing a social plugin by making a CURL (or similar) call to:

http://developers.facebook.com/tools/debug?url={YOUR_URL}&format=json

This is mentioned in the OG docs at http://developers.facebook.com/docs/opengraph/#edit although links to the older URL for the OG Linter.

I believe linting/scraping a page such as this should register any social plugins on the page without requiring you to visit the page first.

Edit: See also the Updating Objects section at the bottom of this doc: https://developers.facebook.com/docs/opengraph/objects/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜