如何通过用户的个人资料网址获取用户的ID? [英] How to get user's id by user's profile url?

查看:81
本文介绍了如何通过用户的个人资料网址获取用户的ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,当用户将其个人资料网址输入文本框时,例如 http://www.facebook.com /Google . 表单立即显示Google徽标(这是Google的facebook paeg的徽标).

Now when the user input his personal profile url to a textbox, such as http://www.facebook.com/Google. The form immediately show the Google logo(it's the Google's facebook paeg's logo).

如果我知道页面ID,则可以通过以下方式显示Google徽标:

If I know the page id,I can show the Google logo in this way:

http://graph.facebook.com/[USER_ID]/图片

http://graph.facebook.com/[USER_ID]/picture

但是如何知道任何api的用户ID?

But how to know the user id with any api?

推荐答案

您可以通过解析url,然后转到 https://graph.facebook.com/Google 并解析json响应.您还可以解析网址以获取个人资料照片: https://graph.facebook.com/Google/picture

You can get the user id by parsing the url and then going to https://graph.facebook.com/Google and parsing the json response. You can also parse the url to get the profile photo: https://graph.facebook.com/Google/picture

这篇关于如何通过用户的个人资料网址获取用户的ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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