https://github.com/blairnangle/unfollow-stale
Script to unfollow Twitter accounts that have gone a specified number of days without tweeting.
https://github.com/blairnangle/unfollow-stale
python tweepy twitter twitter-api
Last synced: 2 months ago
JSON representation
Script to unfollow Twitter accounts that have gone a specified number of days without tweeting.
- Host: GitHub
- URL: https://github.com/blairnangle/unfollow-stale
- Owner: blairnangle
- License: mit
- Created: 2020-04-02T07:59:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T09:22:26.000Z (over 2 years ago)
- Last Synced: 2025-01-25T11:41:55.527Z (4 months ago)
- Topics: python, tweepy, twitter, twitter-api
- Language: Python
- Homepage:
- Size: 219 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unfollow-stale
[](https://github.com/blairnangle/unfollow-stale/actions/workflows/unfollow.yml)
Script to unfollow Twitter accounts that have gone a specified number of days without tweeting.
Makes use of the [Twitter API](https://developer.twitter.com/en/docs/api-reference-index) and
[Tweepy](https://www.tweepy.org).## Prerequisites
* [Python 3](https://www.python.org/downloads/)
* [pip](https://pypi.org/project/pip/) (included by default with Python versions >= 3.4)
* [venv](https://docs.python.org/3/library/venv.html) (included by default with Python versions >= 3.3)## Installation
* Create a virtual environment:
```shell
python3 -m venv venv
```
* Activate the virtual environment:```shell
source venv/bin/activate
```* Install requirements:
```shell
pip install -r requirements.txt
```## Usage
### Obtaining Authentication Tokens
You will need to create a Twitter App to generate authentication keys and tokens. Navigate to
[Twitter Apps](https://developer.twitter.com/en/apps/create), sign in with your Twitter credentials and create a new
app:
Accept the terms, go to "Keys and tokens" and generate an access token and secret key.
### Authentication
#### Local
```shell
export CONSUMER_KEY=
export CONSUMER_KEY_SECRET=
export ACCESS_TOKEN=
export ACCESS_TOKEN_SECRET=
```#### GitHub Actions
The environment variables above should be stored as GitHub Actions Secrets.
### Executing
To run the script (the virtual environment needs to have been activated using [above instructions](#installation)
and the credentials need to have been exported as env vars):```bash
$ ./go.py
```## License
Distributed under [MIT License](./LICENSE).