{"id":20070280,"url":"https://github.com/kallewesterling/twittersheep","last_synced_at":"2025-06-12T02:44:42.508Z","repository":{"id":169404393,"uuid":"180863250","full_name":"kallewesterling/twittersheep","owner":"kallewesterling","description":"Remember TwitterSheep.com and how it used to work? This is a simple Python port of the website.","archived":false,"fork":false,"pushed_at":"2021-05-13T17:58:49.000Z","size":3020,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T23:44:01.833Z","etag":null,"topics":["scraping","twitter","visualization","visualization-tools","wordcloud"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kallewesterling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-11T19:26:04.000Z","updated_at":"2021-05-13T17:58:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d7f65d5-e6cd-4f81-8532-40c12b96e03e","html_url":"https://github.com/kallewesterling/twittersheep","commit_stats":null,"previous_names":["kallewesterling/twittersheep"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kallewesterling%2Ftwittersheep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kallewesterling%2Ftwittersheep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kallewesterling%2Ftwittersheep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kallewesterling%2Ftwittersheep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kallewesterling","download_url":"https://codeload.github.com/kallewesterling/twittersheep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241502773,"owners_count":19972956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scraping","twitter","visualization","visualization-tools","wordcloud"],"created_at":"2024-11-13T14:21:28.381Z","updated_at":"2025-03-02T11:40:32.996Z","avatar_url":"https://github.com/kallewesterling.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TwitterSheep Python Port\n\nRemember TwitterSheep.com and how it used to work? \n\nWell, I wrote a simple Python port that works the same way (ish). Feel free to suggest changes via pull requests or issues.\n\nThe result is a wordcloud like this one (based on [my twitter account](http://www.twitter.com/kallewesterling)):\n\n![Image showing an example of my wordcloud generated using the script.](images/my_wordcloud.png)\n\n## Requirements\n\nYou have to install a couple of Python packages for this script to run:\n- tweepy\n- wordcloud\n- progressbar\n- matplotlib\n\nYou can use `pip install` to install all of the packages above (i.e. `pip install tweepy` etc.).\n\n## How-to\n\n### Step 1\n\nFill in [your Twitter credentials](https://developer.twitter.com/en/apply-for-access.html) in `config.py`:\n\n```python\n    '''\n    Set up your Twitter authentication here.\n    '''\n    CONSUMER_KEY = \"**************************\"\n    CONSUMER_SECRET = \"**********************************************\"\n    ACCESS_TOKEN = \"********-**********************************************\"\n    ACCESS_TOKEN_SECRET = \"**********************************************\"\n```\n\n### Step 2\n\nImport the TwitterSheep class from the file:\n\n```python\nfrom twittersheep import TwitterSheep\n```\n\n### Step 3\n\nRun the TwitterSheep class using the username you want to use:\n\n```python\nherd = TwitterSheep(username=\"kallewesterling\")\n```\n\nIt will take some time when you run the script the first time as it has to download all the data from Twitter, and the `tweepy` package will manage the rate limit for you.\n\nIf you don't want to see progress bars while the script runs, you can run it with the `quiet` option set to `True`:\n\n```python\nherd = TwitterSheep(username=\"kallewesterling\", quiet=True)\n```\n\n### Step 4\n\nSave the wordcloud made from all of your followers\n\n```python\nherd.save_wordcloud()\n```\n\nUsed with no settings, the script will save a 1500x1000 pixel PNG file based on the top 1000 words in the bios from your followers and your friends (the people you follow) to `wordcloud.png` in the directory where you placed `twittersheep.py`.\n\nIf you want to show words from bios of only your followers (the original intent of TwitterSheep.com), then use the setting `only_followers` set to `True`:\n\n```python\nherd.save_wordcloud(only_followers=True)\n```\n\n## Customizations\n\n### 1. Saving to a Specific File\n\nSometimes you may want to save your wordcloud to a specific place. You can do so by adding the option `path` and provide a valid path to the `save_wordcloud()` method:\n\n```python\nherd.save_wordcloud(path=\"../Desktop/my_real_unique_wordcloud.png\")\n```\n\nMake sure that the path that you're adding the file to exists and that the file ending is `.png` as you will be saving a PNG file.\n\n\n### 2. Adding Stopwords\n\nIf you want to add stopwords to remove certain words from your wordcloud—say, for instance, if you already knew that some keywords would occur but you wanted to make clearer which ones were unexpected.\n\nIn the following example, I have chosen to remove a few keywords that I already knew would occur frequently in my follower's bios: theatre, digital, digital humanities, cuny, phd, candidate, phd student, student, and new york. I do so by adding the option `extend_stopwords` to the function and providing it with a list of the words:\n\n```python\nherd.save_wordcloud(only_followers=True, extend_stopwords=['theatre', 'digital', 'digital humanities', 'cuny', 'phd', 'candidate', 'phd student', 'student', 'new york'])\n```\n\nThe result can be seen in the following two wordclouds:\n\nNo added stopwords             |  After adding stopwords\n:-------------------------:|:-------------------------:\n![](images/my_wordcloud.png)  |  ![](images/my_wordcloud_after_filtering.png)\n\n\n### 3. Getting All The Bios\n\nIf you want to see a list of all the bios in your herd, you can do so by accessing the list variables: `herd.friend_bios` and `herd.follower_bios`.\n\nIf you want to see all of the bios, you can access them through the list variable `herd.bios`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkallewesterling%2Ftwittersheep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkallewesterling%2Ftwittersheep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkallewesterling%2Ftwittersheep/lists"}