问题
I've seen the ability to order by hotness in some tutorials for the SoundCloud API. Eg the following in PHP:
// create a client object with your app credentials
$client = new Services_Soundcloud('APP KEY');
// find all sounds of buskers licensed under 'creative commons share alike'
$tracks = $client->get('tracks', array('genre' => json_encode($tag), 'limit' => '20', 'order' => 'hotness')); // array('q' => 'dubstep'));
$tracks=json_decode($tracks);
die(var_dump($tracks));
However this returns a list of tracks with 0 plays and there is no mention of this sorting in SoundClouds documentation:
http://developers.soundcloud.com/docs/api/sdks#methods
回答1:
Yes, the order parameter has recently been removed. From the API blog on April 16th, 2013:
Starting soon, GET requests to the /tracks endpoint will ignore the order parameter and default to ordering by creation date.
...
In the meantime, it is still possible to approximate the result sets previously returned by specifyingorder=hotness
by manually sorting the returned tracks by a combination offavoritings_count
andplayback_count
.
http://developers.soundcloud.com/blog/removing-hotness-param
来源:https://stackoverflow.com/questions/16697959/has-order-by-hotness-been-removed-from-soundclouds-api