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

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 !

Related

Embed Facebook Live video comments on page

I am using Facebook Live inside of a web app to live stream videos. I am wondering if it is possible to include the live commenting associated with the video on my site in real time. I know I can grab the comments from the graph API, however this is not real time. The comment embed widget is also not real time and would need to be constantly refreshed.
The documentation says :
"You can read live video comments by polling the Live Video
Comments
edge."
What is polling? How do I do this and is it possible from a front end web app.
Basically my question is how do I include the live comments along with Facebook Live video on my own website.
This is now available via SSE streams
https://developers.facebook.com/docs/graph-api/server-sent-events/endpoints/live-comments
I know I can grab the comments from the graph API, however this is not real time.
This is as real time as it can get. If someone posts a comment and you immediately query the Graph API, you will see their comment.
What is polling?
As there is currently no streaming data endpoint for comments, you must query the comments on the live video repeatedly. That is, every 2 seconds or so, refresh the data.
This is done by making a Graph API GET request for /{video-id}/comments. I also suggest setting "order": "reverse_chronological" in the parameters so that you get the newest comments first.
You can see some sample code for doing this as part of the Live Comments Teleprompter: https://github.com/fbsamples/live-comments-teleprompter/blob/master/js/main.js#L89-L103

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.

Tracking Soundcloud plays using Facebook Pixel

This is my first post, I'm glad to join the community. I have very limited, practically no experience with coding, however I am working on something that requires me to jump into coding, so here I am.
My objective is to use the Facebook Advertising tracking pixel to track Soundcloud plays on my page and ultimately target people who have been listening to my tracks on Soundcloud.
Facebook usually allows you to track conversions from your own website, however it says that If you do not own the website where you are trying to track some information from, you should contact the website and ask them.
I have tried contacting Soundcloud but obviously received no response.
I was wondering wether there was a way to get around the issue that I do not own the website and therefore cannot copy and paste the Facebook pixel into Soundcloud's HTML.
I have done some research online, looking into forums, but there seems to be no discussion about this online, at least nothing that I could understand with my limited knowledge.
Here are a few links i checked out before posting here, unfortunately with little success.
http://www.unified.com/developers/earned-measurement/guides/conversion-soundcloud-plays/
http://www.unified.com/developers/earned-measurement/apis/conversions-js/
Thank you for your time,
Any help is appreciated.
Kindest regards,
Oliviero

Playlist not refreshed after adding a track via API

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?

Is there a 'complete' event on embedded facebook videos?

I want to embed a facebook video in a webapp but do something when it's over.
Similarly to the YouTube API Player, is there any 'complete' event I can listen to on embedded FB videos?
One solution/workaround a friend reminded me of is embedding the mp4 in jwplayer and hooking into the player's events API.
Sounds like it might work, but I would rather use a better solution is there is one.