Simple Spring Social for Twitter Friends
Join the DZone community and get the full member experience.
Join For FreeThe Spring Social project provides us developers with an easy way to interact with Twitter, Facebook, LinkedIn & TripIt via the familiar Template objects we have used. Spring has provided Templates for convenient interaction with JDBC, REST, Hibernate, JNDI, and more.
One of the simplest social media calls is to lookup someone’s Twitter friends with the TwitterTemplate.
1. Add the Spring Social project dependency to the pom.xml file
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>${spring.social.version}</version>
</dependency>
...
</dependencies>
2. Add the Spring Milestone Repository repository to the pom.xml file
3. Create the TwitterTemplate, and ask for friends
4. Use the code above anywhere in your application
In the next blog, I will cover how to use Open Authentication (OAuth) to perform more Twitter operations.
From http://gordondickens.com/wordpress/2011/01/03/simple-spring-social-for-twitter-friends/
Opinions expressed by DZone contributors are their own.
Comments