如何确定 Facebook 用户是否上传了个人资料图片或默认图片? [英] How to determine if a Facebook user has uploaded a profile picture or its default?

查看:21
本文介绍了如何确定 Facebook 用户是否上传了个人资料图片或默认图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过FQL 还是别的什么?

Is there a way to know if a user uploaded an image to the profile or it has the default user picture of Facebook via FQL or somthing else?

推荐答案

您可以使用下面的 Python 脚本(未提及任何编程语言)使其工作.

You can use the Python script below (as not mentioned any programming language) to make it work.

urllib.urlopen('https://graph.facebook.com/<PROFILE_ID>/picture?access_token=%s' % access_token).geturl()

这将为您提供 Facebook 个人资料照片 URL.如果该 URL 包含 ,则它上传图像.否则会上传默认的 Facebook 图片.

This will provide you a Facebook profile photo URL. If that URL contains <PROFILE_ID> then it uploads an image. Else the default Facebook image is uploaded.

例如,如果上传的图片:

For example, if uploaded image:

http://profile.ak.fbcdn.net/hprofile-ak-snc4/195361_<PROFILE_ID>_4179703_q.jpg

其他:

男性:

http://b.static.ak.fbcdn.net/rsrc.php/v1/yo/r/UlIqmHJn-SK.gif

女性:

https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v1/y9/r/IB7NOFmPw2a.gif

我希望这会有所帮助.

这篇关于如何确定 Facebook 用户是否上传了个人资料图片或默认图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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