Where can I download org.springframework.http.client.AbstractBufferingClientHttpRequest.jar
I am trying to get a simple application running that connects to Twitter and pulls out the timeline, but i am failing in the basic stuff. I am using Spring-Social to do that and the documentation says that this code should work in creating a connection:
TwitterConnectionFactory connectionFactory = new TwitterConnectionFactory("consumerKey", "consumerSecret");
OAuth1Operations oauth1Operations = connectionFactory.getOAuth1Operations();
String requestToken = oauth1Operations.fetchRequestToken("callbackUrl");
String authorizeUrl = oauth1Operations.buildAuthorizeUrl(requestToken, OAuth1Parameters.NONE);
response.sendRedirect(authorizeUrl);
// when the provider callback is received with the oa开发者_高级运维uth_token and oauth_verifier parameters:
OAuthToken accessToken = oauth1Operations.exchangeForAccessToken(new AuthorizedRequestToken(oauthToken, oauthVerifier));
Connection<TwitterApi> connection = connectionFactory.createConnection(accessToken);
However, when I run it in debug, when it hits the third line it throws a class "AbstractBufferingClientHttpRequest" not found exception. I have included the "org.springframework.http.client.AbstractClientHttpRequest.class" , but I need the one with the extra 'Buffered' word and I can't find it anywhere. pls help.
I would skip using the Connect
Framework and just instantiate the TwitterApi
directly. Keep life simple, especially if you are only interested in retrieving your timeline.
public void GetMyTimeline()
{
TwitterApi twitterApi = new TwitterApi(
consumer_key, consumer_secret, access_token, access_token_secret);
TwitterProfile myProfile = twitterApi.userOperations().getUserProfile();
System.out.printf("Id: %s, Name: %s, ScreeName: %s\n",
profile.getId(), profile.getName(), profile.getScreenName());
List<Tweet> tweets = twitterApi.timelineOperations().getPublicTimeline();
// Iterate over tweets List for the 20 most recent public tweets.
// Do other API calls here...
}
The long list of JAR files imported into my project in order for it to compile and run correctly:
Looks like this class is available in 3.1.0.M2 release of spring. You can read here on how to obtain the artifacts related to this using maven/ivy here.
精彩评论