来自网址的Facebook ID [英] Facebook ID from URL

查看:70
本文介绍了来自网址的Facebook ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出一个Facebook网址,例如 http://facebook.com/cnn ,有什么方法可以获取该页面的ID不足以刮取吗?

Given a facebook url such as http://facebook.com/cnn, is there any way to get the ID of that page short of scraping it?

推荐答案

使用图形API进行此操作更好(并且合法).只需执行对https://graph.facebook.com/cnn的API请求,并从响应中获取ID.

It is better (and legal) to do this with graph API. Just perform API request to https://graph.facebook.com/cnn and get id from the response.

这是cnn的响应:

{
   "id": "5550296508",
   "name": "CNN",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs178.ash2/41813_5550296508_728_s.jpg",
   "link": "http://www.facebook.com/cnn",
   "category": "Company",
   "website": "www.cnn.com\nwww.ireport.com\n",
   "username": "cnn",
   "company_overview": "TRIVIA FROM THE CNN TOUR...",
   "products": "CNN US...",
   "likes": 1689936
}

这篇关于来自网址的Facebook ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆