Skip to content

Instantly share code, notes, and snippets.

View michaellavelle's full-sized avatar

Michael Lavelle michaellavelle

  • London, UK
View GitHub Profile
LastFm lastFm = new LastFmTemplate("myLastFmApiKey");
Page<LastFmProfile> friends = lastFm.userOperations().getFriends("michaellavelle");
Page<Track> lovedTracks = lastFm.userOperations().getLovedTracks("michaellavelle");
Page<TrackSearchResult> searchResults = lastFm.trackOperations().searchByArtistAndTrackName("Stevie Nicks", "Edge of Seventeen");
<repositories>
<repository>
<id>opensourceagility-snapshots</id>
<url>http://repo.opensourceagility.com/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.social<groupId>
<artifactId>spring-social-lastfm</artifactId>
LastFmAccessGrant lastFmAccessGrant = new LastFmAccessGrant("usersAuthenticationToken","usersAuthenticationSessionkey");
LastFm authenticatedLastFm = new LastFmTemplate(lastFmAccessGrant,"myApiKey","myApiSecret");
authenticatedLastFm.userOperations().love("Stevie Nicks", "Edge of Seventeen");
LastFm authenticatedLastFm = connectionRepository.getPrimaryConnection(LastFm.class).getApi();
authenticatedLastFm.userOperations().scrobble(new SimpleTrackDescriptor("Stevie Nicks","Edge of Seventeen"),new Date());
SoundCloud soundCloud = new SoundCloudTemplate("mySoundCloudApiKey");
Page<Track> searchResults = soundCloud.tracksOperations().search("monsieur adi dancing with the dj");
Page<Track> favorites = soundCloud.usersOperations().userOperations("mattslip").getFavorites();
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());
}
SoundCloud authenticatedSoundCloudApi = connectionRepository.getPrimaryConnection(SoundCloud.class).getApi();
<repositories>
<repository>
<id>opensourceagility-snapshots</id>
<url>http://repo.opensourceagility.com/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.social<groupId>
<artifactId>spring-social-soundcloud</artifactId>

Keybase proof

I hereby claim:

  • I am michaellavelle on github.
  • I am michael_lavelle (https://keybase.io/michael_lavelle) on keybase.
  • I have a public key whose fingerprint is 27F7 8338 37CD 0FEF 38CA 0C18 8FC7 694C 83AD E2C1

To claim this, I am signing this object: