Examples of TwitterTemplate


Examples of org.springframework.social.twitter.TwitterTemplate

import org.springframework.social.twitter.TwitterTemplate;

public class SearchDemo {

  public static void main(String[] args) {
    TwitterTemplate template = new TwitterTemplate();
    SearchResults results = template.search("#springintegration");
    for (Tweet tweet : results.getTweets()) {
      System.out.println(tweet.getFromUser() + ": " + tweet.getText());
    }
  }
View Full Code Here

Examples of org.springframework.social.twitter.TwitterTemplate

public class FriendsDemo {

  public static void main(String[] args) {
    String username = "m_f_";
    TwitterTemplate twitterTemplate = new TwitterTemplate();
    List<String> friends = twitterTemplate.getFriends(username);
    for (String friend : friends) {
      System.out.println(friend);
    }
  }
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

    return gateway;
  }

  @Bean
  public Twitter twitter() {
    return new TwitterTemplate(env.getProperty("twitter.oauth.consumerKey"),
        env.getProperty("twitter.oauth.consumerSecret"),
        env.getProperty("twitter.oauth.accessToken"),
        env.getProperty("twitter.oauth.accessTokenSecret"));
  }
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

    return new ObjectToJsonTransformer();
  }

  @Bean
  public Twitter twitter() {
    return new TwitterTemplate(env.getProperty("twitter.oauth.consumerKey"),
        env.getProperty("twitter.oauth.consumerSecret"),
        env.getProperty("twitter.oauth.accessToken"),
        env.getProperty("twitter.oauth.accessTokenSecret"));
  }
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

public class Twitter implements ITwitter {

  private TwitterTemplate twitter;

  public Twitter(){
    twitter = new TwitterTemplateApplicationConstants.TWITTER_CONSUMER_KEY,
                    ApplicationConstants.TWITTER_CONSUMER_SECRET,
                    ApplicationConstants.TWITTER_ACCESS_TOKEN,
                    ApplicationConstants.TWITTER_ACCESS_TOKEN_SECRET);
  }
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

   */
  @Bean
  @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES
  public Twitter twitter() {
    Connection<Twitter> twitter = connectionRepository().findPrimaryConnection(Twitter.class);
    return twitter != null ? twitter.getApi() : new TwitterTemplate();
  }
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

*/
public class AbstractTwitterInboundChannelAdapterTests {

  @Test
  public void testStop() throws Exception {
    TwitterTemplate twitter = mock(TwitterTemplate.class);
    RestTemplate template = mock(RestTemplate.class);
    when(twitter.getRestTemplate()).thenReturn(template);
    final CountDownLatch latch = new CountDownLatch(1);
    AbstractTwitterInboundChannelAdapter adapter = new AbstractTwitterInboundChannelAdapter(twitter) {

      @Override
      protected void doSendLine(String line) {
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

      Connection<Twitter> connection = repository
          .findPrimaryConnection(Twitter.class);
      if (connection != null) {
        return connection.getApi();
      }
      return new TwitterTemplate(this.properties.getAppId(),
          this.properties.getAppSecret());
    }
View Full Code Here

Examples of org.springframework.social.twitter.api.impl.TwitterTemplate

 
  @Bean
  @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES
  public Twitter twitter() {
    Connection<Twitter> twitter = connectionRepository().findPrimaryConnection(Twitter.class);
    return twitter != null ? twitter.getApi() : new TwitterTemplate();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.