Fetch the IDs of users I follow on Twitter, using vege-table:
var url = 'https://api.twitter.com/1.1/friends/ids.json'; var params = { screen_name: ‘invisiblecomma’, stringify_ids: true, count: 5000 }; var collection = new Collection(url, params); collection.items = function(data) { return data.ids; } collection.next = function(data) { if (!data.next_cursor) { return null; } params.cursor = data.next_cursor_str; return [url, params]; } return collection.get('json');
Using similar code, fetch the list of users that each of those users follows.
Export the 10,000 user IDs with the highest intra-network follower counts.
Fetch the details of each Twitter user:
return Resource('https://api.twitter.com/1.1/users/lookup.json', { user_id: user_id }).get('json').then(function(data) { return data[0]; });
Process those two CSV files into a list of pairs of connected identifiers suitable for import into Gephi.
In Gephi, drag the “Topology > In Degree Range” filter into the Queries section, and adjust the range until a small enough number of users with the most followers is visible:
Set the label size to be larger for users with more incoming links:
Set the label colour to be darker for users with more incoming links:
Apply the ForceAtlas 2 layout, then the Expansion layout a few times, then the Label Adjust layout:
Switch to the Preview window and adjust the colour and opacity of the edges and labels appropriately. Hide the nodes, set the label font to Roboto, then export to PDF.
Use imagemagick to convert the PDF to JPEG:
convert —density 200 twitter-foaf.pdf twitter-foaf.jpg
It would probably be possible to automate this whole sequence - perhaps in a Jupyter Notebook. The part that takes the longest is fetching the data from Twitter, due to the low API rate limits.