How to extract number of followers of a user from twitter website using WebView in Android?

323 Views Asked by At

I want to program an Android app -for android 2.1 and above- that does not have to be authorized to extract just the number of followers of a twitter user.

I was thinking about using the WebView to load the twitter URL of the user and then I extract the content of the web page and then the number of followers.

How can I do that?

1

There are 1 best solutions below

0
On BEST ANSWER

A better solution might be to use the twitter4j library. If you do, it's as simple as:

Twitter myTwitter = new TwitterFactory().getInstance();
long[] followerIds = myTwitter.getFollowersIDs("screenName", -1).getIDs();

The number of followers is the length of the follower ID array;