Python scripts for analysing social networks on Twitter through Ego Networks of accounts on lists or searched by keywords
There are three scripts:
- twitter-lists-egonetworks.py: ask you for a Twitter username, from which you can select multiple lists. The script will then analyse the connections (followers/following) among all the accounts in the lists, and save the results as a .gexf file.
- twitter-search-egonetworks.py: indicate the keywords to be searched in the keyword variable. The script will then search for users on Twitter with those keywords and then analyse the connections (followers/following) among all the accounts, and save the results as a .gexf file.
- data_anonymization.py: loads a .gexf file and save an anonymized version.
pip install networkx
pip install twitter
- twitter-lists-egonetworks.py / twitter-search-egonetworks.py: Create a Twitter App here. Edit the file and add the details of the app, and run the script with:
python twitter-lists-egonetworks.py
or
python twitter-search-egonetworks.py
- data_anonymization.py: Edit the file and add the filename for the .gexf input and output files, and run the script with:
python data_anonymization.py