I have hooked up my Twitter account to Mathematica and I have 1468 followers

myfollowers = Length[SocialMediaData["Twitter", "Followers"]]


I wondered what my follower network would look like but the returned graph was far too simple looking:

a = SocialMediaData["Twitter", "FollowerNetwork"]

enter image description here

The graph only has 32 vertices:


Looking at the names of the Twitter users it has included, it seems that it has only considered the most recent people who have followed me.

So, how do I get Mathematica to consider all of my followers?

  • $\begingroup$ Unrelated to your question, but could you check if you can access another account's public follower list if you authorize the app? $\endgroup$ – rm -rf Dec 1 '12 at 14:05
  • $\begingroup$ Yes I can. Interestingly, this is limited too. For example hugelist = SocialMediaData[{"Twitter", "stephenfry"}, "Friends"] returns a list that is only 5000 followers long. However, Mr Stephen Fry has over 5,000,000 followers! Limitations on the Twitter API perhaps? $\endgroup$ – WalkingRandomly Dec 1 '12 at 14:52
  • $\begingroup$ I don't know if this is the answer or not but, when applying SocialMediaData to Facebook, a similar thing happens, i.e. the vertex count of my Friends Network is strictly smaller than my number of Friends. In that context, I believe the reason has to do with my friends privacy settings which doesn't necessarily allow me to friends' friends. $\endgroup$ – Mark McClure Dec 1 '12 at 17:46
  • $\begingroup$ Sounds reasonable for Facebook. Not so for Twitter. Only a tiny fraction of my followers would have a locked account. $\endgroup$ – WalkingRandomly Dec 1 '12 at 17:56

To honor Twitter rate limits, "FollowerNetwork" property gives a subgraph of the follower network.


You can build the full follower network (at your own risk):

With[{followers = SocialMediaData["Twitter", "Followers"], 
mutual = Complement[Intersection[
                    SocialMediaData[{"Twitter", #1}, "Followers"], #2], {#1}] &}, 
Quiet[Graph[Flatten[Table[Thread[f -> mutual[f, followers]], {f, followers}]]]]]
  • 1
    $\begingroup$ Thanks for that. Killed my kernel. Perhaps I am asking for too much all in one go. So, I wonder how best to build this up a piece at a time so that I don't hit the rate limit? Would also be fun to watch the graph build up slowly. $\endgroup$ – WalkingRandomly Dec 1 '12 at 21:21
  • $\begingroup$ @WalkingRandomly Maybe what hangs is the graphical output? 1468 is a a lot to plot. Can you try g = ... ; to suppress graphical output. And then see if you can work with properties like EdgeList[g]//Length - which i bet is a huge number. BTW - great blog you have - I enjoy reading it. $\endgroup$ – Vitaliy Kaurov Dec 2 '12 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.