Some Deezer Song IDs can not be fetched from EchoNest - deezer

I am trying to get some EchoNest parameters like valence and arousal for songs using the Deezer ID for the query. For the most songs it works fine, but sometimes it seems like there is no connection between the Deezer ID and the EchoNest ID.
For example this famous song:
Katy Perry - Roar
www.deezer.com/track/69863371
Query:
http://developer.echonest.com/api/v4/track/profile?api_key=EGJMZDJPOFDOWHUJV&id=deezer:track:69863371&bucket=audio_summary
Answer:
{"response": {"status": {"version": "4.2", "code": 5, "message": "The Identifier specified does not exist"}}}
If I try it by ARTIST and TITLE it's working:
http://developer.echonest.com/api/v4/song/search?api_key=EGJMZDJPOFDOWHUJV&format=json&results=1&artist=katy%20perry&title=roar&bucket=audio_summary
Is this the only way in this case?
Thanks
Patrick

Related

facebook open graph api - filter node collection by field

At a high level, what I'm looking for is all of the posts a specific user has made in a group.
I can access the group feed, which contains all posts made in the group, like this:
GET 2.10/<group-id>/feed
where 2.10 is the api version I am using
I can see the author of all the posts in the feed by reading the "from" field:
GET 2.10/<group-id>/feed?fields=from
the "from" field displays a user, which is represented as a JSON object with two properties:
"from": {
"name": <user_name>,
"id": <user_id>
}
some collections have "read modifiers", for example on a feed that belongs to a person's profile, you can filter for only posts that have locations attached to them:
GET 2.10/me/feed?with=location
It seems a "read modifier" on the group feed would be what is needed, however none are documented: https://developers.facebook.com/docs/graph-api/reference/v2.10/group/feed
Is there any way to filter the feed so that it returns only posts by a specific author?
rephrased more generally:
is it possible to filter a collection of nodes by a node attribute?
is there another possible way to query for posts made by a specific person in a specific group?

Get highest scores from facebook Graph API

I'm using facebook graph API in my Unity Application. What I'm trying to do is to retrieve the users using my application and show the first 20 ones ordered by score.
In the example project "friend smash" there's the following graph API call:
FB.API("/app/scores?fields=score,user.limit(20)", Facebook.HttpMethod.GET, ScoresCallback);
This, as far as I know, gets 20 users who are using my application. Due to the poor graph API documentation I can't understand if user.limit(20) just returns 20 random users, or ordered with some criteria.
If this call returns random users, do I have to send one query for each friend, sort them by score and show only the first 20 ones to get a proper ranking? (I guess it would be quite query heavy though)
In Facebook Graph Explorer use following GET request to receive friends with score (descending order):
app/scores?fields=score&limit=20
It should return following Json:
{
"data":
[
{
"score": 1,
"user":
{
"name": "1st Name",
"id": "first_id"
}
},
{
"score": 0,
"user":
{
"name": "2nd Name",
"id": "2nd_id"
}
}
]
}
https://developers.facebook.com/docs/games/scores/#read-many-scores:
You can read the set of scores for a player and their friends by issuing an HTTP GET request to /APP_ID/scores with the user access_token for that app. The user_friends permission is required in order to view friends' scores. This returns a list of scores for a player and friends who have authorized the app. The list is sorted by descending score value, so it returns friends with the highest scores first.
(Highlighting by me.)

Facebook FQL returns no result, while GraphAPI does

I'm trying to get Facebook user information by username. I'm trying to make following FQL request:
SELECT first_name, last_name FROM user WHERE username="Google"
I got no data in response:
{
"data": [
]
}
Same query works OK for other usernames:
SELECT first_name, last_name FROM user WHERE username="c1egger"
This gives me:
{
"data": [
{
"first_name": "Paul",
"last_name": "Dmitryev"
}
]
}
I've tried to use GrapAPI with following request:
/Google?fields=id,name
And got the result:
{
"name": "Google",
"id": "104958162837"
}
Also, I'm getting same problem, when trying to query by userid.
Major part of my application uses FQL, so I'd like to figure out why FQL not working, before starting complex porting to FQL.
They are not the same request...
/Google?fields=id,name
That request doesn't check in "User" table, that's why you can't retrieve user "google" with '104958162837' id.
facebook.com/c1egger and facebook.com/Google are not the same type of page.
select name from page where page_id=104958162837
or
select page_id from page where username='Google'
Gives you the same result as the graph api.
FQL works, but it's more complex that GraphApi to use.
Facebook Query Language, or FQL, enables you to use a SQL-style interface to query the data exposed by the Graph API. It provides advanced features not available in the Graph API.

How to get shares count for a Photo in Facebook?

I want to get comments count, likes count and shares count for a page posts. I have their IDs and I'm trying to figure something out with the Graph API or FQL, but in vain.
For regular posts I can query the stream FQL table and I get the comment_info, like_info structures and shares_count variable.
For posted photos I can query the photo table and I get from there comment_info and like_info, but it lacks the shares_count.
I tried using Graph api like that: GET /550045508388715 and it returns a ton of information, but nothing related to share count.
I've googled that issue, but did not found any relevant solution.
Instead of GET /ID use GET /POST_ID to get the shares count (if >1). You'll get the result as-
"shares": {
"count": x
}
Note- the Post ID is generally: USERID_PHOTOID ORPAGEID_PHOTOID

How to retrieve Facebook likes with descriptions

How can I get list of facebook likes (pages that user has liked ) with descriptions
Im using /me/likes object, but it won't give me likes descriptions. I understand I can use FQL with "WHERE page_id in (LIST_OF_IDS)" - or request for every like separately
Is there any way to get it with one request ?
Yes, this can be done via FQL with the following query:
SELECT name, description FROM page WHERE page_id IN (SELECT page_id
FROM page_fan WHERE uid=me())
https://developers.facebook.com/tools/explorer?fql=SELECT%20name%2C%20description%20FROM%20page%20WHERE%20page_id%20IN%20(SELECT%20page_id%20FROM%20page_fan%20WHERE%20uid%3Dme())%0A
Or this way using the Graph API: USER_ID?fields=likes.fields(description)
If it is possible with the Graph API, don´t take FQL. The Graph API is usually faster and easier:
me/likes?fields=id,name,description
Result (from my account):
"data": [
{
"id": "244993732224805",
"name": "Jón Gnarr",
"created_time": "2012-12-06T00:35:43+0000"
},
{
"id": "161086703983",
"name": "Design Shack",
"description": "We only offer the cream of great design, filtering through lots of the redesigns that occur every day across the Internet, and cataloguing the greatest projects out there - perfect for getting that spark of creativity going again.\n\t\nRegular articles will teach you new techniques for creating your own designs, and daily community news ensures that you're up to date with the latest developments elsewhere.\n\t\nIf you want to be updated every time a new design or tutorial is added, you can subscribe:\n\t\nDesign Shack RSS Feed\nhttp://feeds.feedburner.com/designshack\n\nTwitter\nhttp://twitter.com/designshack",
"created_time": "2012-12-04T14:40:08+0000"
},
{
"id": "274797542535942",
"name": "Chasing Aurora",
"description": "Chasing Aurora is an explorative 2D aerial action game about the dream of flight.\n\nDrop from the cliff and ride the wind from peak to peak. Fight for the beacon of light with up to three friends in the hostile environment of the Alps.",
"created_time": "2012-12-04T12:07:13+0000"
},
...