是否有服务或方式获取与Facebook对象调试器页面相同的信息?

时间:2012-01-10 23:49:02

标签: facebook facebook-graph-api

我们正在创建一个项目,其中包含一个URL列表,我想显示一些关于每个页面的信息,就像Facebook在帖子中添加链接一样。

是否有服务或API调用返回图形属性的JSON,就像在Facebook Object Debugger底部生成的那样? (例如:http://graph.facebook.com/421751811580

reading graph API表示我可以将URL作为ID传递。但是,对于某些URL,它不会将所有数据作为调试工具返回。 (例如:https://graph.facebook.com/?ids=http://www.terra.com.br

我的另一个想法是使用URL调用对象调试器并解析页面。但我不确定这是安全的还是Facebook允许的。 (例如:http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.terra.com.br

这是导致我?ids = 信息的post

2 个答案:

答案 0 :(得分:0)

更新[2014年11月6日] :遗憾的是,添加format=json对当前版本的Facebook OG调试器没有任何影响。

在您的通话中添加& format = json。我很想做很多调用,只是因为它不是官方API的一部分。

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.terra.com.br&format=json

{
   "warning":[
      {
         "type":"Inferred Property",
         "message":"The og:url property should be explicitly provided, even if a value can be inferred from other tags."
      },
      {
         "type":"Inferred Property",
         "message":"The og:title property should be explicitly provided, even if a value can be inferred from other tags."
      },
      {
         "type":"Inferred Property",
         "message":"The og:image property should be explicitly provided, even if a value can be inferred from other tags."
      },
      {
         "type":"Inferred Property",
         "message":"The og:locale property should be explicitly provided, even if a value can be inferred from other tags."
      }
   ],
   "info":[
      {
         "type":"fb:admins",
         "message":[
            1640032884
         ]
      },
      {
         "type":"og:url",
         "message":"http:\/\/www.terra.com.br\/portal\/"
      },
      {
         "type":"og:type",
         "message":"website"
      },
      {
         "type":"og:title",
         "message":"Terra - Not\u00edcias, v\u00eddeos, esportes, economia, divers\u00e3o, m\u00fasica, moda, fotolog, blog, chat"
      },
      {
         "type":"og:image",
         "message":[
            "http:\/\/p2.trrsf.com.br\/image\/get?o=cf&w=89&h=67&src=http\u00253A\u00252F\u00252Fp2.trrsf.com.br\u00252Fimage\u00252Ffget\u00252Fcf\u00252F300\u00252F300\u00252Fimg.terra.com.br\u00252Fi\u00252F2012\u00252F01\u00252F12\u00252F2176927-3276-rec.JPG"
         ]
      },
      {
         "type":"og:updated_time",
         "message":1326392389
      }
   ],
   "debug":[
      {
         "type":"Meta Tag",
         "message":"\u003cmeta property=\"fb:admins\" content=\"1640032884\" \/>"
      }
   ]
}

答案 1 :(得分:0)

已经有一段时间了,但我最近有一些关于这个功能的问题。在我们的项目中,我们最终使用http://embed.ly/

它没有Facebook那么完整,但它给了我们足够的信息以完成令人满意的结果。

相关问题