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?
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- facebook error invalid key hash for some devices
- LoginActivty with Firebase & Facebook authenticati
- Google places autocomplete suggestion without coun
相关文章
- 我用scrapy写了一个蛮简单的爬虫怎么封装成一个api啊
- 后端给前端的API接口是怎么用代码写的
- Use savefig in Python with string and iterative in
- Facebook login for group members
- Where does this quality loss on Images come from?
- Specifying image dimensions in HTML vs CSS for pag
- Convert C# Object to Json Object
- How to insert pictures into each individual bar in
From my experiments with the Facebook API, it appears one has to actually get the picture in order to tell whether it's a static default one or not.
At the time of writing, it appears that all uploaded photos on Facebook are converted to JPEG, while the static default pictures are in the GIF format. (BTW, this is not consistent with some thumbnail sizes).
Looking for specific GIF file or a specific URL path is not reliable (note that there are CDN URLs involved, and that there are different static files for male and female). Assuming Facebook doesn't re-encode their entire profiles photos database, I suppose looking for a GIF is reliable enough.
Here's a sample PHP function to do this. I've tested it successfully with my 120 Facebook friends, and it seems to do the job.
You can use the Python script below (as not mentioned any programming language) to make it work.
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:
else:
For male:
For female:
I hope this helps.
If a user doesn't have a photo then the is_silhouette field will be true when you request the user object with the "photo" field specified.
Example request:
Response:
Quick, dirty PHP function: