Skip to content

Instantly share code, notes, and snippets.

@michaellavelle
Created March 22, 2012 15:14
Show Gist options
  • Save michaellavelle/2158929 to your computer and use it in GitHub Desktop.
Save michaellavelle/2158929 to your computer and use it in GitHub Desktop.
SoundCloud authenticatedSoundCloudApi = new SoundCloudTemplate("myApiKey","mySessionKey");
Page<Track> tracks = authenticatedSoundCloudApi.tracksOperations().search("monsieur adi dancing with the dj");
Track firstResult = tracks.getNumberOfElements() > 0 ? tracks.getContent().get(0) : null;
if (firstResult != null)
{
authenticatedSoundCloudApi.meOperations().favoriteTrack(firstResult.getId());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment