Playlist not refreshed after adding a track via API - deezer

I'm trying to integrate Deezer with Slack. A user would be able to type !play Blackmill - Let It Be in Slack and via a webhook to Deezer API a track would be added to our room's playlist.
To add a track I post to http://api.deezer.com/playlist/123456789/tracks?songs=22945401, it returns true, and the track is actually added. But in the browser where the playlist is currently playing I don't get the new track until a page refresh, so the playlist just stops after the last track that was already there.
I know there's collaborative playlists which somehow work in a similar fashion, so I'm hoping it's possible to implement what I described.
Is there a way I can tell Deezer to refresh the playlist? Or maybe there's a better approach altogether?

Related

How can I determine if a Soundcloud track is a preview (Soundcloud GO) based on its URL?

My app retrieves tracks from Soundcloud and plays them.
But since a few weeks, it seems that Soundcloud has changed the way it works; and now I often get "preview" tracks; so I can only listen to 30s.
I would like to invalidate those tracks in my app.
Is there a way to do this ?
It seems there is nothing in the URL that permits to recognize those tracks. Maybe I have to do an API call it.
I'm searching for the most basic solution possible.
Thanks !

How to get track URIs from the Spotify API

I am currently writing a program which utilizes the Spotify API
I have a program which is capable of playing a track if I have the track URI. My problem is that I am having trouble figuring out how to get the track URI by calling the Spotify API. I was trying to use the SPTRequest class as this was what was in a video which was linked from the Spotify API page, but this is a deprecated class and I am having a lot of trouble figuring out how to navigate these classes. What would I do to get a Spotify track URI if for example I was searching by song name?
You're looking for the Search endpoint!
It will return a track object, which contains the track uri.

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

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.

Can track belong to the application and not individual users?

My application isn't going to be revolved around soundcloud users, I will be using it for its nice api that is provided to stream audio. I also want to use the javascript upload feature but that seems to be out of the question too.
The record widget should be able to upload the audio to your server so that you can upload the audio not as an individual user.
I still haven't been able to get my app to work without using their authentication window.
Any help would be appreciated.
Nearly everything you do with the SoundCloud API must be done on behalf of a SoundCloud account. You can only use the SoundCloud API to stream content from or upload content to a SoundCloud account.
If you'd like to have SoundCloud functionality in your app, I'd recommend allowing users to connect their SoundCloud accounts.
"Authenticating without the SoundCloud Connect Screen", from the API docs: http://developers.soundcloud.com/docs/api/guide#user-credentials
With this method you can log in as a user in the code. Since every app must be registered to a user anyway, you can make a new username to register the app, and log in with that one.

Facebook Connect - Add events to an Events Page (not profile)

I have created Facebook pages with an events tab. I am currently trying to add events to this events page via the Facebook connect API but can't work out how do it.
I can add events to my profile no problem.
Can anyone tell me how to add events to a page, is it possible?
Alternatively is there a way I can add an event to my profile and have my page automatically pick up this event (I can't see anything in the settings for this?).
Any help very much appreaciated!
Thanks
C
Current API doesn't support this as far as I can see.
There is an API function which is in beta at the moment (but doesn't seem to be working as
yet) which according to the documentation is designed to publish a post into the stream on the wall of a user, group, page or event, so this should provide the functionality needed.