Music meta missing from Facebook /home
When somebody shares a Spotify playlist, the attachment is missing from the Graph API.
What is shown in Facebook:
What is returned by the Graph API:
{
"id": "********_******",
"from": {
"name": "*****",
"id": "*****"
},
"message": "Refused's setlist from last night's secret show in Sweden...",
"icon": "http://photos-c.ak.fbcdn.net/photos-ak-snc1/v85005/74/174829003346/app_2_174829003346_5511.gif",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/*****/posts/*****"
},
{
"name": "Like",
"link": "http://www.facebook.com/*****/posts/*****"
},
{
"name": "Get Spotify",
"link": "http://www.spotify.com/redirect/download-social"
}
],
"type": "link",
"application": {
"name": "Spotify",
"canvas_name": "get-spotify",
"namespace": "get-spotify",
"id": "174829003346"
},
"created_time": "2012-03-01T22:24:28+0000",
"updated_time": "2012-03-01T22:24:28+0000",
"likes": {
"data": [
{
"name": "***** *****",
"id": "*****"
}
],
"count": 1
},
"comments": {
"count": 0
},
"is_published": true
}
There's absolutely no reference to an attachment, other than the fact the type is 'link' and the application is Spotify.
If you want to test, Spotify's page (http://graph.facebook.com/spotify/feed) usually has a playlist or two embedded (and missing from Graph API). Also if you filter your home feed to just Spotify stories (http://graph.facebook.com/me/home?filter=app_174829003346), you'll get a bunch of useless stories without attachments (assuming your friends shared music recently)
Anyone have any ideas how to access the playlist details, or is it unavailable to third party developers (if so, this is a very a bad user experience, because the story makes no sense without the attachment).
I am able to fetch scrobbles without any trouble using the user_actions.listens. Also, if there is a recent activity story, eg "Peter listened to The Shins", I am able to get information about the band. The problem only happens on attachments.
There's no public API for getting information about Spotify playlists. What's available is the public landing pages on open.spotify.com
, for example this playlist: http://open.spotify.com/user/esset09/playlist/1mpigLgHAAyrZh9a99NlXb.
If you really want to get hold of the playlist info (and if you're bold) I guess you might be able to go rogue and scrape it off of the playlist page (using YQL or a custom scraper). However, there's probably a bunch of Javascript loading going on there, so it might not be that easy to scrape it.
I found the same to be true, that there is no way (currently) to pull information about the playlist, or band name for songs, from the Graph API. I would agree that you can pull what you need from http://open.spotify.com and not too difficult if you are use the Open Graph Protocol.
There are a number of helper libraries available. I use opengraph for Python. It's a lot easier than building a scraper and just pulls the tags you want.
链接地址: http://www.djcxy.com/p/55860.html