Skip to content

It detects the communities within a twitter network. It does this by first getting the friends and followers and then detecting the reciprocal friends. It then again gets the friends and followers of the top 5 reciprocal friends list and creates a network on which the communities are detected

Notifications You must be signed in to change notification settings

AmritbaniKaur/SMM2-Twitter-Community-Detection

Repository files navigation

Twitter Community Detection

This code gets all the friends and followers of 'TheRealStanLee' and builds a friendship graph

It Crawls their followers, with depth 3 and limit 5 for each level

Gets the friends and followers of them and store it in a dict format

It then, extracts reciprocal friends through these two lists, with a distance of 1

From this new list, it selects top 5 followers and get the friends and followers of depth 2 and a limit of 5 for each level

and saves it to a .json file

Then, using this data it creates a community graph and colors the nodes wrt to the different communities they belong to


P.S.: you have to create your twitter developer account in order to get the following information:

  • consumer_key
  • consumer_secret
  • token
  • token_secret

and you can then store this info in a file (I have stored it in the auth_dict file) whose location will be the current folder of the .ipynb file it will be of json format


About

It detects the communities within a twitter network. It does this by first getting the friends and followers and then detecting the reciprocal friends. It then again gets the friends and followers of the top 5 reciprocal friends list and creates a network on which the communities are detected

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published