Skip to content
Browse files

Update README

  • Loading branch information...
1 parent 199f391 commit a0d5590ffb8ca284e2b4796f3778d3e44e9c7a80 @michaellavelle committed
Showing with 13 additions and 9 deletions.
  1. +13 −9 README
View
22 README
@@ -12,23 +12,27 @@ To use this functionality, create a Spring Social-enabled webapp and simply regi
with the ConnectionFactoryRegistry, eg:
@Bean
- @Scope(value="singleton", proxyMode=ScopedProxyMode.INTERFACES)
- public ConnectionFactoryLocator connectionFactoryLocator() {
- ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
- registry.addConnectionFactory(new SoundCloudConnectionFactory(environment.getProperty("soundCloud.consumerKey"),
- environment.getProperty("soundCloud.consumerSecret")));
- return registry;
- }
+@Scope(value="singleton", proxyMode=ScopedProxyMode.INTERFACES)
+public ConnectionFactoryLocator connectionFactoryLocator() {
+ ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
+
+ registry.addConnectionFactory(new SoundCloudConnectionFactory(
+ environment.getProperty("soundCloud.consumerKey"),
+ environment.getProperty("soundCloud.consumerSecret")));
+ return registry;
+}
Once the user has given permission to your Spring Social webapp to use their SoundCloud account ( see
http://www.springsource.org/spring-social for more details ), an authenticated API client can be obtained from the
user's connection:
- Connection<SoundCloud> soundcloudConnection = connectionRepository.findPrimaryConnection(SoundCloud.class);
+ Connection<SoundCloud> soundcloudConnection =
+ connectionRepository.findPrimaryConnection(SoundCloud.class);
SoundCloud authenticatedSoundCloudApi = soundcloud.getApi();
- Page<Track> tracks = authenticatedSoundCloudApi.tracksOperations().search("monsieur adi dancing with the dj");
+ Page<Track> tracks =
+ authenticatedSoundCloudApi.tracksOperations().search("monsieur adi dancing with the dj");
Track firstResult = tracks.getNumberOfElements() > 0 ? tracks.getContent().get(0) : null;

0 comments on commit a0d5590

Please sign in to comment.
Something went wrong with that request. Please try again.