Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá amigos, eu tenho um perfil no facebook com diversos alguns e cada album com diversas fotos.
alguem sabe como posso "reaproveitar" e exibi-las como galeria de imagens em meu site pessoal ?
eu preciso configurar alguma coisa no meu facebook ?
no meu perfil eu tenho uma pagina com um album, tenho minha id e um token, mas quando eu coloco eles no parametros dos links a respostas nao traz minhas fotos, apenas informaçoes do album e de perfil.
https://graph.facebook.com/290074327670908
olha o que ele traz :
{
"id": "290074327670908",
"name": "Raminelli",
"category": "Games",
"subcategory": "Action & Arcade",
"link": "http://www.facebook.com/apps/application.php?id=290074327670908",
"canvas_name": "raminelli",
"namespace": "raminelli",
"icon_url": "http://static.ak.fbcdn.net/rsrc.php/v1/yT/r/4QVMqOjUhcd.gif",
"logo_url": "http://static.ak.fbcdn.net/rsrc.php/v1/yq/r/IobSBNz4FuT.gif"
}
cade as fotos ?
Você leu a documentação?
Sem lê-la vai ser bem difícil você conseguir implementar e, como não acredito que você tenha lido tudo, não acredito que você conseguirá.
Primeiro passo :seta: http://developers.facebook.com/docs/authentication/
Após ler completamente, comece a ler as operações da API que interessam ao que você pretende como Album e Photo. Tudo o que você precisa está na documentação.
:seta: Exemplo para os albuns:
Request:
https://graph.facebook.com/290330580978616?method=GET&metadata=true&format=json&access_token={SEU_ACCESS_TOKEN}
Response:
{
"id": "290330580978616",
"from": {
"name": "Raminelli",
"canvas_name": "raminelli",
"namespace": "raminelli",
"id": "290074327670908"
},
"name": "5 de outubro de 2011",
"link": "http://www.facebook.com/album.php?fbid=290330580978616&id=290074327670908&aid=82167",
"cover_photo": "290330600978614",
"count": 2,
"type": "album",
"created_time": "2011-10-05T12:03:28+0000",
"updated_time": "2011-10-05T12:03:35+0000",
"metadata": {
"connections": {
"photos": "https://graph.facebook.com/290330580978616/photos?access_token=AAADMbfWdWuUBAH5yHLtvydBqW1UdTYAwWWXKZCP2u6HlhAlIlo4nsZCoG9j3jyqZCJUEBP1qGgarXpwsLnHgaCk7RZCvZB5ypIU3njxCV6PA1LfWSFJ1B",
"likes": "https://graph.facebook.com/290330580978616/likes?access_token=AAADMbfWdWuUBAH5yHLtvydBqW1UdTYAwWWXKZCP2u6HlhAlIlo4nsZCoG9j3jyqZCJUEBP1qGgarXpwsLnHgaCk7RZCvZB5ypIU3njxCV6PA1LfWSFJ1B",
"comments": "https://graph.facebook.com/290330580978616/comments?access_token=AAADMbfWdWuUBAH5yHLtvydBqW1UdTYAwWWXKZCP2u6HlhAlIlo4nsZCoG9j3jyqZCJUEBP1qGgarXpwsLnHgaCk7RZCvZB5ypIU3njxCV6PA1LfWSFJ1B"
},
"fields": [
{
"name": "id",
"description": "The album ID. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "from",
"description": "The profile that created this album. Any valid access_token. object containing id and name fields."
},
{
"name": "name",
"description": "The title of the album. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "description",
"description": "The description of the album. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "location",
"description": "The location of the album. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "link",
"description": "A link to this album on Facebook. Any valid access_token or user_photos or friend_photos. string containing a valid URL."
},
{
"name": "cover_photo",
"description": "The album cover photo ID.Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "privacy",
"description": "The privacy settings for the album. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "count",
"description": "The number of photos in this album. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "type",
"description": "The type of the album: profile, mobile, wall, normal or album. Any valid access_token or user_photos or friend_photos. string."
},
{
"name": "created_time",
"description": "The time the photo album was initially created. Any valid access_token or user_photos or friend_photos. string containing ISO-8601 date-time"
},
{
"name": "updated_time",
"description": "The last time the photo album was updated. Any valid access_token or user_photos or friend_photos. string containing ISO-8601 date-time"
}
]
}
}
:seta: Exemplo para as fotos do álbum:
Request:
https://graph.facebook.com/290330580978616/photos/?method=GET&format=json&access_token={SEU_ACCESS_TOKEN}
Response:
{
"data": [
{
"id": "290330600978614",
"from": {
"name": "Raminelli",
"canvas_name": "raminelli",
"namespace": "raminelli",
"id": "290074327670908"
},
"picture": "http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/298783_290330600978614_290074327670908_1266410_17005235_s.jpg",
"source": "http://a8.sphotos.ak.fbcdn.net/hphotos-ak-snc7/298783_290330600978614_290074327670908_1266410_17005235_n.jpg",
"height": 489,
"width": 720,
"images": [
{
"height": 489,
"width": 720,
"source": "http://a8.sphotos.ak.fbcdn.net/hphotos-ak-snc7/298783_290330600978614_290074327670908_1266410_17005235_n.jpg"
},
{
"height": 122,
"width": 180,
"source": "http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/298783_290330600978614_290074327670908_1266410_17005235_a.jpg"
},
{
"height": 88,
"width": 130,
"source": "http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/298783_290330600978614_290074327670908_1266410_17005235_s.jpg"
},
{
"height": 50,
"width": 75,
"source": "http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/298783_290330600978614_290074327670908_1266410_17005235_t.jpg"
}
],
"link": "http://www.facebook.com/photo.php?pid=1266410&id=290074327670908",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"created_time": "2011-10-05T12:03:31+0000",
"position": 1,
"updated_time": "2011-10-05T12:03:32+0000"
},
{
"id": "290330617645279",
"from": {
"name": "Raminelli",
"canvas_name": "raminelli",
"namespace": "raminelli",
"id": "290074327670908"
},
"picture": "http://photos-b.ak.fbcdn.net/hphotos-ak-ash4/300704_290330617645279_290074327670908_1266411_1360281265_s.jpg",
"source": "http://a2.sphotos.ak.fbcdn.net/hphotos-ak-ash4/300704_290330617645279_290074327670908_1266411_1360281265_n.jpg",
"height": 405,
"width": 720,
"images": [
{
"height": 405,
"width": 720,
"source": "http://a2.sphotos.ak.fbcdn.net/hphotos-ak-ash4/300704_290330617645279_290074327670908_1266411_1360281265_n.jpg"
},
{
"height": 101,
"width": 180,
"source": "http://photos-b.ak.fbcdn.net/hphotos-ak-ash4/300704_290330617645279_290074327670908_1266411_1360281265_a.jpg"
},
{
"height": 73,
"width": 130,
"source": "http://photos-b.ak.fbcdn.net/hphotos-ak-ash4/300704_290330617645279_290074327670908_1266411_1360281265_s.jpg"
},
{
"height": 42,
"width": 75,
"source": "http://photos-b.ak.fbcdn.net/hphotos-ak-ash4/300704_290330617645279_290074327670908_1266411_1360281265_t.jpg"
}
],
"link": "http://www.facebook.com/photo.php?pid=1266411&id=290074327670908",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"created_time": "2011-10-05T12:03:35+0000",
"position": 2,
"updated_time": "2011-10-05T12:03:36+0000"
}
]
}
:seta: http://developers.fa.../reference/api/
Um exemplo usando uma foto na página do Facebook e os comentários na foto :seta: https://graph.facebo...pM_v49h1xPwkqs4
Depois de recuperar as informações que precisa, utilize a função json_decode() para poder manipular os dados.