Can't get some user's last tracks with Soundcloud SDK - api

I currently have an issue with the Soundcloud Javascript SDK.
When using the method : SC.get('/users/USER_ID/tracks', [params])
It work perfectly fine for some users, but I get an empty array with other.
The account and tracks are all public.
I read somewhere that apparently it could be the label who block the access on the tracks.
To explain RTMP, even if a track is set to public and streamable by the artist, if the artist is under a major label, this label can further control those streaming permissions. So, it looks like it should stream correctly, however it doesn't.
Does someone have an idea why this doesn't work for some users?

Related

How to write Spotify API in processing?

For my project in college I have decided to make an interactive map where, when the user hovers over a country the title of the top song in that country is displayed. I wanted to get that title from Spotify charts.
I have read every single page of the Spotify API guide and I am still confused as to how should I write the query in processing. I have the authorisation code and the OAuth token, but I'm not sure how should I include it in the actual sketch.
I really need all the help I can get, I am very new to this and I will appreciate every bit of advice.
Use a Spotify API Java Wrapper such as this one to handle API requests to Spotify.
Wrappers are external libraries that simplify API interfacing by providing functions that you can call from your code to make API requests. See this webpage for information about including external libraries in Processing sketches if you haven't done this before.
The most-played track per country isn't likely to change during operation of your program so requesting (it seems you've identified the correct API endpoint for this) the top track for each country just once is sufficient. This process could be done in setup(), for example, since it runs once only.
Then it's a matter of storing the data from these requests in some sort of data structure to allow your program to retrieve the most played track of the country that is being hovered over. A HashMap of country name to top track is appropriate, but there are many viable approaches.

Soundcloud API returns empty

Thanks in advance for the help.
So while developing an application, I need API data and I retrieve JSON objects. Not a big deal, but with one certain account it doesn't work.
https://api.soundcloud.com/tracks/257255126?client_id=CLIENT_ID_HERE
The ID 257255126 is a track from this profile: https://soundcloud.com/discoverysounds1/.
Every track from this profile returns empty from the API while the same API link works if I insert a track ID from any other profile.
I've already notified the owner of the problem and he hasn't done anything weird or disabled API access if that's even possible.
What could be the problem here?
Thanks,
Jordan
I just tested this with a website I am developing using the API.
If I add one of the tracks to an existing playlist that I have created to test certain functionality, the track does not appear in the playist when retrieved via the /me/playlists endpoint.
When I load the playlist into the soundcloud widget, the track is visible and unrestricted (as in full duration and not a 30 second preview).
I am seeing similar behaviour with tracks that are marked as "soundcloud go" not being visible in the playlist tracks from the /me/playlists endpoint, but available via the widget when the playlist is loaded (albeit only a 30 second preview in their case).
Those items are identifiable as having a "SUB_HIGH_TIER" monetization_model
The track I loaded from your example
There seem to be various issues with the API right now related to the implementation of "soundcloud go"

Searching on geolocation in the SoundCloud API?

The SoundCloud API allows you to search. Coordinates (lat/lng) seem to be stored as tags in the tag_list property for tracks. It seems I can filter on matching tags.
Can I use the SoundCloud API to find matching tracks with a geospatial bounding box or a centre with a radius?
Or can I only match coordinates exactly?
If the former, how?
The SoundCloud blog posts talking about mapping audio links to maps that don't open. For example:
http://maps.soundcloudlabs.com/?lat=32.47269502206151&lon=13.359375&maxOffset=50&zoom=3
Furthermore, I'm unable to add geotags to my files on SoundCloud. Adding them as tags and saving the file fails silently: Upon reopening the file for editing, the geotags do not show up.
Third, SoundCloud API calls for tracks do not seem to include geotags.
Fourth, searching for a geotag using the SoundCloud API consistently returns no results.
Therefore, it is safe to assume that SoundCloud no longer supports geocoding on their audio files.

Check if there are any SoundCloud players playing

I need to find out if it is possible to check if there are any sound cloud players playing (or if there are none playing) on a page at any given point.
The sound cloud api seems to allow you to check if a player is paused but i'm not sure if this apply's to all players on a page or not?
Any thoughts or pointers would be much appreciated.
Not an expert on this but looking at the embedded widget page, they are using an iFrame, meaning it's running in an isolated environment. Unless they go out of their way to provide this feature (using cross-document messaging for example), it won't be possible.
(Well, if you want to go for a really weird hack, you could request the user's microphone permissions and detect the audio playing :)
You could just make a separate SC.widget object for each player on the page. You could create a script to find them if all the iframes on the page are soundcloud players like this:
var widgets=new Array();
$('iframe').each(function (index, iframe) {
widgets.push(SC.Widget(iframe));
});
Then you could check if all of them are paused.

Is there an efficient way to obtain my friend's photos from Facebook API?

A little background info; I'm making an iOS App that uses facebook integration. I am using Parse (www.parse.com) as my back-end to store the facebook ids, and anything else I need for my App. On the app, I have three views which show the following: My photos, My friends, My Public photos. These are not ALL photos, but just the ones that correspond to the App (Similar to when you upload a photo from your phone, it uploads to the "Mobile Uploads" album). Getting my photos and my public photos is easy since I just make a query to parse requesting the photo ids whose author is me.
Now my full question is the following. If I were to have an Array containing all of my friend's facebook IDs, is there a way to obtain all their photos that correspond to my App WITHOUT iterating for each element in this array? I do not wish to do this since it would mean sending N requests to the server, which is not so efficient. Does any one know a work around to this?
Use FQL to query for the photos in your app's albums (https://developers.facebook.com/docs/reference/fql/photo/). aid==album id.
You can narrow the search using and IN clause tied to the specific album id's you want http://developers.facebook.com/docs/reference/fql/album/