Skip to content

jayniehaka/nz-mp-tweeters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

New Zealand MPs on Twitter

This graph visualisation shows how New Zealand Members of Parliament are connected on Twitter as at 19/11/17. It can be viewed here: http://jayniehaka.github.io/nz-mp-tweeters/

Data sources

MP Twitter accounts were sourced from a list of MPs on Twitter owned by NZ Parliament, using the Twitter API. MPs were assigned to parties by searching their profile descriptions for party names, and then by manually adding party names for those who did not mention one in their profile.

Making the graph

To access and process the data I used the httr and jsonlite packages in R. mp_tweets.R contains functions to get the data, create the nodes and edges, and write these to a json file. Twitter allows 15 user requests per 15 minute window, so be warned: the make_edges_table function will take a loooooong time to run.

Force-directed graph visualisation

This force-directed graph visualisation uses the D3.js JavaScript library. It is based on Mike Bostock's Les Misérables character graph as well as this Stack Overflow post.

About

Network visualisation of NZ members of parliament on twitter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published