0

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?

SultanSh
  • 103
  • 1
  • 2
  • 11

1 Answers1

2

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;

Krylez
  • 17,414
  • 4
  • 32
  • 41