Package twitter4j.conf

Examples of twitter4j.conf.ConfigurationBuilder


        if (args.length < 2) {
            System.out.println("Usage: java twitter4j.examples.media.TwitpicImageUpload [API key] [image file path] [message]");
            System.exit(-1);
        }
        try {
            Configuration conf = new ConfigurationBuilder().setMediaProviderAPIKey(args[0]).build();
            ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.TWITPIC);
            String url;
            if (args.length >= 3) {
                url = upload.upload(new File(args[1]), args[2]);
            } else {
View Full Code Here


    private static JSONObject getJSONObjectFromClassPath(String path) throws Exception {
        return new JSONObject(getStringFromClassPath(path));
    }

    private JSONObject getJSONObjectFromGetURL(String url) throws Exception {
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.setUser(id1.screenName);
        builder.setPassword(id1.password);
        return getJSONObjectFromGetURL(url, builder.build());
    }
View Full Code Here

        HttpClient http = HttpClientFactory.getInstance(conf.getHttpClientConfiguration());
        return http.post(url).asJSONObject();
    }

    private JSONObject getJSONObjectFromPostURL(String url) throws Exception {
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.setUser(id1.screenName);
        builder.setPassword(id1.password);
        return getJSONObjectFromPostURL(url, builder.build());
    }
View Full Code Here

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

    private JSONArray getJSONArrayFromGetURL(String url) throws Exception {
        ConfigurationBuilder builder = new ConfigurationBuilder();
        builder.setUser(id1.screenName);
        builder.setPassword(id1.password);
        return getJSONArrayFromGetURL(url, builder.build());
    }
View Full Code Here

TOP

Related Classes of twitter4j.conf.ConfigurationBuilder

Copyright © 2018 www.massapicom. 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.