Example usage for twitter4j.conf PropertyConfiguration OAUTH_CONSUMER_KEY

List of usage examples for twitter4j.conf PropertyConfiguration OAUTH_CONSUMER_KEY

Introduction

In this page you can find the example usage for twitter4j.conf PropertyConfiguration OAUTH_CONSUMER_KEY.

Prototype

String OAUTH_CONSUMER_KEY

To view the source code for twitter4j.conf PropertyConfiguration OAUTH_CONSUMER_KEY.

Click Source Link

Usage

From source file:org.springframework.social.showcase.twitter.connect.TwitterServiceProvider.java

License:Apache License

@Override
public Twitter getApi(String accessToken, String secret) {
    Properties props = new Properties();
    props.setProperty(PropertyConfiguration.OAUTH_CONSUMER_KEY, getConsumerKey());
    props.setProperty(PropertyConfiguration.OAUTH_CONSUMER_SECRET, getConsumerSecret());
    props.setProperty(PropertyConfiguration.OAUTH_ACCESS_TOKEN, accessToken);
    props.setProperty(PropertyConfiguration.OAUTH_ACCESS_TOKEN_SECRET, secret);
    Configuration conf = new PropertyConfiguration(props);
    return new TwitterFactory(conf).getInstance();
}

From source file:org.springframework.social.showcase.twitter.Twitter4JServiceProvider.java

License:Apache License

@Override
protected Twitter getApi(String consumerKey, String consumerSecret, String accessToken, String secret) {
    Properties props = new Properties();
    props.setProperty(PropertyConfiguration.OAUTH_CONSUMER_KEY, consumerKey);
    props.setProperty(PropertyConfiguration.OAUTH_CONSUMER_SECRET, consumerSecret);
    props.setProperty(PropertyConfiguration.OAUTH_ACCESS_TOKEN, accessToken);
    props.setProperty(PropertyConfiguration.OAUTH_ACCESS_TOKEN_SECRET, secret);
    Configuration conf = new PropertyConfiguration(props);
    return new TwitterFactory(conf).getInstance();
}