Accessing User 'Most Listened To' using Spotify / Echo Nest / Facebook API - facebook

I want to know if I can access a user's play history (more specifically what songs they listen to the most) for an app. The app I am building can perform the same goal with iTunes using their built-in play counter. I know Spotify uses a similar counter, but I assume for privacy concerns they don't want to deal with privacy concerns from concerned users. However, I saw a few instances where it was suggested that this task could be accomplished using Facebook's API, or Echo Nest's API. Please let me know if anyone has some constructive suggestions toward finding a way to legally obtain a particular users 'most listened to songs', or something to that effect.
SB

There's some documentation about Open Graph Music on the Facebook Developer homepage:
https://developers.facebook.com/docs/opengraph/music/
Baseline is that you only can request a User's play history if he gave you app the explicit right to read his data.
The relevant permissions would be
user_actions.music https://developers.facebook.com/docs/facebook-login/permissions/v2.1#reference-user_actions_music
user_actions:{app_namespace} https://developers.facebook.com/docs/facebook-login/permissions/v2.1#reference-user_actions__app_namespace_
Then, you should be able to request
GET /me/music.listens
according to https://developers.facebook.com/docs/reference/opengraph/action-type/music.listens/ You'll need to perform the aggregation of the most played songs/artists yourself, because there's no endpoint for that.

Related

How to retrieve Facebook home news feed for apps?

I am currently attempting to retrieve the news feed from my Facebook home feed to include into an app. I know this used to be able to be done with the API however I have heard that it has since been removed. Is there any other way that you know of that would work or has it been added back into the API? It doesn't make sense why they would remove it.
No, there is no way to get a user’s feed via API. That used to be possible in the very early days (API v1), but has long since been removed.
It doesn't make sense why they would remove it.
Apart from user privacy (I don’t want my posts getting analyzed by some shady app with a developer located in $godKnowsWhere, just because they appeared on the feed of a friend of mine who might be using questionable apps), Facebook considers this a “core feature” – and 3rd-party apps are not supposed to replicate those in the first place. Facebook wants to make money from showing me ads when I view my feed, so allowing any other app to perform the same functionality would just mean loss of revenue.

Facebook Marketing API ads_management review

We're trying to use the Facebook Marketing API ads_management permission. We want to use the permission to allow our clients to push the media that was created for them on our app to their personal ad manager
Based on their allowed usage, it sounds like we're utilising this correctly but every app review is being rejected with a fairly generic
Your screencast doesn't show how the use of this permission directly improves the user experience in your app. Unfortunately, we also weren't able to determine this from testing your app manually.
For the first point - our screencast shows a brand/client navigating our app to where all their media lies - connect their facebook account - select the media and then push to the ad manager
This gives us the correct response as long as we use their sandbox environment on the Marketing API
On the second point Unfortunately, we also weren't able to determine this from testing your app manually
We provide test credentials for them to login into our application and go through the exact steps demonstrated in the screencast.
I know these reviews have been giving a number of developers issues but would love to hear if we're missing something really basic in our use because the usecase is really straightforward and not really sure how else to demonstrate it
Thanks

Caching Feeds from Facebook, Twitter & Instagram

I'm building a site for a non-profit festival where we'd like to have a 'media' page which brings in photos from instagram (hashtag search), updates and photos from Facebook (via festival's albums) twitter posts (by user and hashtag).
I've tried the JS widgets for Facebook and Twitter but wondered about using PHP/Codeigniter to pull the feeds and caching them somehow for better performance and more control over the look.
Would it be best to then store the feed data in a json file on the server or in a MySQL record?
I'm leaning toward a table with a record for each feed that would basically just store the feed URL, JSON, last updated time and an identifier of some sort.
Then I could write a class with the following type of methods:
get_feed($id='facebook_updates', $expiry_time=3600);
Does this seem like a reasonable way to go? or is there a better solution already existing?
I'm not quite sure how I'd work that in with the feeds that need Auth (twitter & Instagram)
bro!
First, it does seem a reasonable way to do it and I don't know any better.
But, if I had to accomplish that, I would break my problem in two:
A server side code to grab the info from the services (that I would
probably store as json so that I could use the info returned
directly) running with cronjobs from time to time.
A client side (server would work too) one to show that info with
customized style.
To work with the feeds that need auth, you'll have to create an app in each of them, authorize it to access your personal account and use it in the code. Never worked with Instagram but the others have good documentation on how to do that.
Finally, with some modification, you may be able to use this wonderful too to help you accomplish your task: http://plugins.in1.com/socialist

Facebook: detecting user apps

Hello I've read the docs and am having trouble getting a definitive answer for the following questions:
Can our app detect if another app is used by a given user. What about if we are admin of, or have the id of both apps.
If one of the apps is removed from FB is there a way to tell if a user had it installed before it was removed? A sort of history of past apps, I guess.
Here:
FB Connect: is there a way to see the logged in user's facebook apps?
Best answer is "I think the most you can do..." but I'd like to know for sure.
Thanks for any help.
If you request the permission user_actions:APP_NAMESPACE you can see the open graph actions that the user has performed in that app.
http://developers.facebook.com/docs/authentication/permissions/#open_graph_perms
In my apps I generally store the user ID of all authorized users in a database, and when I get a call via the "Deauthorize Callback URL" I don't delete the user from the database, but instead only flag the user as deauthorized.
This way I can easily get an overview of users that are using (or have used) any of my apps. This allows me to present special features for users who are using several of my apps.
For example, let's say I made a photo app (like Instagram) and a GPS running app (like Endomondo). If the user takes a photo with Instagram while running with Endomondo, I could present the option to GPS-tag the photo, or add the photo to Endomondo.
This is something that I think we developers should use more. Perhaps present an open API to other apps, to let the apps work together.

Start collecting user data after app has already been live for a while

I have a basic question about a facebook app I am building. In the first phase, we are building the app so that it doesn't collect any user information, thus keeping the user from having to click the "allow" button to use the app. However, we are considering adding features to the app later on that would require user information. I am just curious if it is a good idea to build it like this, or if we should just collect user information from the start. Would users think it is strange for an app to start collecting data after the app is already live? Any advice is appreciated. Thanks!
No it's not a bad idea. Actually Facebook recommends only asking for a permission when needed:
As a best practice, you should only request extended permissions at
reasonable times when the user engages with features that would
require their use. For example, if you are asking the user for the
publish_stream permission in order to create a custom share UI, the
user will better understand the context behind your request if
presented with the permission while interacting with the app's share
functionality.
Please DO visit the document I linked to.