Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgmacias95/twitterfriends
Django app that makes a graph dataset with your friends on twitter
https://github.com/mgmacias95/twitterfriends
django gephi graph graph-dataset social-graph twitter
Last synced: about 3 hours ago
JSON representation
Django app that makes a graph dataset with your friends on twitter
- Host: GitHub
- URL: https://github.com/mgmacias95/twitterfriends
- Owner: mgmacias95
- License: gpl-3.0
- Created: 2017-01-01T20:15:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T21:13:14.000Z (over 7 years ago)
- Last Synced: 2024-08-07T17:30:58.369Z (3 months ago)
- Topics: django, gephi, graph, graph-dataset, social-graph, twitter
- Language: Python
- Size: 12.9 MB
- Stars: 35
- Watchers: 2
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TwitterFriends
![](TwitterFriends.png)
------
Django app that makes a graph dataset with your friends on twitter, on GDF format.This app saves information about you, all people you follow on Twitter and all people they follow using [Tweepy](https://github.com/tweepy/tweepy). This data is used to make a social graph in which you can study relationships between your friends on Twitter.
For example, my social graph, made on Gephi, is:
![graph](graph.png)
## How to use
Once you've cloned the repository, follow these steps to make your own Twitter friends graph:
1. Create a Twitter App on the [Twitter Apps Site](https://apps.twitter.com/)
2. Save your keys as __environment variables__:
```
$ export TWITTER_CONSUMER_KEY=your_twitter_consumer_key
$ export TWITTER_CONSUMER_SECRET=your_twitter_consumer_secret
$ export TWITTER_ACCESS_TOKEN=your_twitter_access_token
$ export TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
```3. Migrate the Django database. You must be on the same directory as `manage.py` file:
```
$ cd TwitterFriends/
$ python manage.py migrate
```4. Once you've done the migration, run the script `save_friends.py` to start saving users from Twitter. This step may take a long time, it depends on how big your Twitter Network is.
```
python save_friends.py
```5. Once you've saved all users (friends and friends of your friends) it's time to create relationships between the users.
```
python create_friendships.py
```6. At this step, we have all data we need. Now let's export the data. Run the server:
```
python manage.py runserver
```7. Open `http://127.0.0.1:8000/` in your browser.
8. Download the network on the format you wish.