graph api撈 facebook 相簿照片連結

https://developers.facebook.com/tools/explorer?method=GET

用graph api
粉絲團ID?fields=albums.fields(type,name,cover_photo,count)
會回傳一堆json

每個Dictionary裡面有
{
"type": "",
"name": "",
"cover_photo": "",
"count": ,
"id": "",
"created_time": "2010-11-:06:22+0000"
},

把type =normal 的顯示出來
然後再看cover_photo的編號去拿縮圖
實在很麻煩!

cover_photo的編號?fields=photos.fields(picture)
拿到列表,每一個dictionary裡面有
{
"picture": "",
"id": "",
"created_time": ""
},
picture裡面的就是照片的連結,要其他大小的縮圖必須要自己再處理一下

有三層graph api要parse 真是夠了


沒有留言: