Examples of OAuthAuthorization


Examples of twitter4j.auth.OAuthAuthorization

     */
    public ImageUpload getInstance(MediaProvider mediaProvider, Authorization authorization) {
        if (!(authorization instanceof OAuthAuthorization)) {
            throw new IllegalArgumentException("OAuth authorization is required.");
        }
        OAuthAuthorization oauth = (OAuthAuthorization) authorization;
        if (mediaProvider == TWITTER) {
            return new TwitterUpload(conf, oauth);
        } else if (mediaProvider == IMG_LY) {
            return new ImgLyUpload(conf, oauth);
        } else if (mediaProvider == TWIPPLE) {
View Full Code Here

Examples of twitter4j.auth.OAuthAuthorization

        String consumerKey = conf.getOAuthConsumerKey();
        String consumerSecret = conf.getOAuthConsumerSecret();
        if (null == consumerKey && null == consumerSecret) {
            throw new IllegalStateException("Consumer key and Consumer secret not supplied.");
        }
        OAuthAuthorization oauth = new OAuthAuthorization(conf);
        oauth.setOAuthAccessToken(accessToken);
        return getInstance(oauth);
    }
View Full Code Here

Examples of twitter4j.auth.OAuthAuthorization

        String consumerKey = conf.getOAuthConsumerKey();
        String consumerSecret = conf.getOAuthConsumerSecret();
        if (null == consumerKey && null == consumerSecret) {
            throw new IllegalStateException("Consumer key and Consumer secret not supplied.");
        }
        OAuthAuthorization oauth = new OAuthAuthorization(conf);
        oauth.setOAuthConsumer(consumerKey, consumerSecret);
        oauth.setOAuthAccessToken(accessToken);
        return new AsyncTwitterImpl(conf, oauth);
    }
View Full Code Here

Examples of twitter4j.auth.OAuthAuthorization

        HttpClient http = HttpClientFactory.getInstance(conf.getHttpClientConfiguration());
        return http.get(url, null, getOAuthOuthorization(conf), null).asJSONArray();
    }

    private OAuthAuthorization getOAuthOuthorization(Configuration conf) {
        OAuthAuthorization oauth = new OAuthAuthorization(conf);
        oauth.setOAuthConsumer(desktopConsumerKey, desktopConsumerSecret);
        oauth.setOAuthAccessToken(new AccessToken(id1.accessToken, id1.accessTokenSecret));
        return oauth;
    }
View Full Code Here

Examples of twitter4j.http.OAuthAuthorization

        new Thread(new Runnable(){
            public void run() {
                try {
                    Configuration conf = new PropertyConfiguration(new Properties());
                    OAuthAuthorization oauth = new OAuthAuthorization(conf,consumerKey,consumerSecret,token);
                    ImageUpload upload = ImageUpload.getTwitpicUploader(TWITPIC_API,oauth);
                    final String resultUrl = upload.upload(file,message);
                    Status s = twitter.updateStatus(message + " " + resultUrl);
                    final String tweetUrl = "http://twitter.com/"+s.getUser().getScreenName()+"/status/"+s.getId();
                    Core.getShared().defer(new Runnable(){
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.