How To Lose Every Follower in 10 Days
Tags: twitter, githooks, python
Published: 2020-05-19 02:07:54

---
title: How To Lose Every Follower in 10 Days
published: true
description: tweet every commit, repository level & account level control
tags: twitter, githooks, python
---

This post originally appeared on the blog [&computers](https://andcomputers.io) and has been truncated a bit.

&computers might not have the answers to growing a twitter following, but we just might have the answers to shrinking one. A step-by-step guide to losing all your twitter followers.


Depending on what type of developer you are, you might have a different pattern of making commits, some people like committing really frequently while some people make commits way less often. It really depends on the nature of the project, who you're working with, team culture, etc. But a generallly accepted rule is to commit early & often.

Anyways, this article is about losing followers.. so I'm sharing a teeny project about how to send a tweet every time you make a commit 😅

If you'd like to see it in action, follow this [account](https://twitter.com/JuiceCoProdigy)


{% twitter 1088956876237217793 %}
you'll get a bunch of tweets like this.. actually these are the only type of tweets you'll get.. enjoy!


<hr/>


1. Get your developer tokens from [Twitter's application developer site](https://apps.twitter.com/) and make sure your permissions are set to "Read and Write"








2. Fill out the `.profiles.ini` file with as many different twitter account keys as you would like. 
 
```
[default] 
CONSUMER_KEY=your_key 
CONSUMER_SECRET=my_secret_key 
ACCESS_TOKEN=my_token 
ACCESS_TOKEN_SECRET=my_secret_token  

[kevindurantactual] 
CONSUMER_KEY=your_key 
CONSUMER_SECRET=my_secret_key 
ACCESS_TOKEN=my_token 
ACCESS_TOKEN_SECRET=my_secret_token  

[kevindurantfanacct] 
CONSUMER_KEY=your_key 
CONSUMER_SECRET=my_secret_key 
ACCESS_TOKEN=my_token 
ACCESS_TOKEN_SECRET=my_secret_token 
```  

3. run `pip install -r requirements.txt` to install dependencies (its just `tweepy` and `configparser`)
   
4. Run `python start_tweeting.py default` to tweet from the account associated with the keys listed under `default` in `.profiles.ini` 
 
6. When prompted select the folder of the repository you are interested in tweeting out commits for.  

7. Watch as all your fake friends unfollow you.

<hr/>

#### Verify it Worked

Go to the local repository that you selected to tweet from and find the `.git` folder. 

<sup>Note that most operating systems have folders that start with "." hidden. To unhide folders on Mac OSX press `Command+Shift+.`</sup>






Once you've found the `.git` folder, look for 2 files named `post-commit` and `post_commit_hook_autogen.py` in the repository's git hooks directory: `your_repo/.git/hooks/`

Open the `post_commit_hook_autogen.py` file and verify that the Twitter API credentials you supplied are present in the config dictionary. It should look like this.

```
python def main():
"""
Get these values from https://apps.twitter.com/
See more detailed instructions in the README.md
"""
cfg = {
    "consumer_key": "some-random-str-thing",
    "consumer_secret": "and-another-one-but-secretive",
    "access_token": "a-long-string-too",
    "access_token_secret" : "a-secretive-long-string"
}
``` 

<hr/>


#### When You Get Tired or Your Follower Count Goes Down to 0 

Run the following command: `bash stop_tweeting.sh`
Supply the path to the repository that you had previously been terrorizing followers from.  

<hr/>

{% github and-computers/HowToTweetEveryCommit no-readme %}




##### Contributing  

Its still pretty early but if you have suggestions, thoughts, feedback, criticism, etc feel free to open a PR or submit an Issue. Thanks in advance :blush: Could definitely use verification that this works on Windows.

<hr/>

###### Supporting
If ya feeling generous, hollr @ the kid :heart: 
[Patreon](https://patreon.com/andcomputers)

BTC: 3EbMygEoo8gqgPHxmqa631ZVSwgWaoCj3m
ETH: 0x2F2604AA943dB4E7257636793F38dD3B1808A9e7
LTC: MQVgzNDgw43YzyUg3XmH3jQ7L8ndVswmN3


<hr/>

<sup>1. adapted from this [gist](https://gist.github.com/kylefrost/f3841e76749dc64f4b5e) I changed the gist a bit by using `Tweepy` library because I was having some issues with oauth-sign and http-post install from tar.gz was giving me problems and python is just easier. hopefully this makes it a bit more usable for someone else. enjoy!</sup>

<sup>[GIF Credit for API Keys](https://www.slickremix.com/docs/how-to-get-api-keys-and-tokens-for-twitter/)</sup>