Java Twitter Update Profile Information

I am developing a Twitter Topics application, a catalog of twitter accounts about specific topics, that manages around 20 twitter accounts. And because I will be adding accounts constantly it became clear to me that I needed to find a way to update the profiles through the app itself.

So I searched around and the twitter api actually does let you update the profile information.

The topics application is written in java. And uses the library provided by java-twitter to communicate with the Twitter API. Fortunately the update profile methods are implemented by the library so I used them.

In order to use the java-twitter library to update profiles you need code similar to the following:

String username = "YourUsernameHere";
String password = "yourPasswordHere";

Api api = Api.builder().username(username).password(password).build();
api.updateProfile()
	.description("Description_Replace")
	.url("URL_Replace").build().post();

So what I did was wrap that code in a method, called the method from inside a loop that iterates over all of my accouns, and there you go. I can update all of the accounts from the application now. I wrote a web interface for sending the updates, so whenever I want I can just click a button that sends the updates.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>