There are many reasons why you may want to increase your Twitter followers: for engagement, status and for greater reach are a few that come to mind. I’m certainly in the latter - more reach == more potential hits to my blog.
If you’re in the status camp you’ll most likely have gone down the route of paying for followers. You know the drill - pay x amount of dollars for x amount of followers. The majority, if not all of these followers are trash accounts; accounts solely created to follow others for no other reason than to increase their follower count. They won’t provide traffic to your blog or engage with you.
If you’re after organic followers then it requires a little more effort than simply paying for them. Real, organically acquired followers can be valuable as they may retweet your tweets, engage with you, or follow links back to your blog. You can painstakingly follow or retweet users in the hope that they’ll check you out and follow you. You could @message them but that’s a little spammy.
Or you could favourite certain tweets and automate the process large scale. I’d favour favouriting over retweeting as it doesn’t pollute your timeline. Less pollution and spam on your timeline means more room for relevant content the user may be interested in, potentially resulting in a new follower.
We’re going to use a mix of simple Python and the Twitter API.
- Search for tweets by related users or content, e.g. tweets containing ‘James Morris’ or tweets with the hashtag ‘#php’.
- Favourite the tweets.
- User gets a notification that their tweet has been favourited. Our timeline stays the same (unlike retweets, favourites don’t get pushed to our timeline).
- User checks out profile of the favouriter and if they see something they like, hopefully we get a new follower!
- Rinse and repeat for more followers.
So when I first started using a script I think my follower count was somewhere in the 400s. After a few weeks to a month of using it - when I remembered (there’s a 24hr limit) - my follower count is up about 75% to the near 700s.
Interactions are up also - some good some pointless. I get users retweeting and favouriting my tweets and some engaging and @messaging me. A lot of users don’t realise it’s just a script blanket favouriting all mentions of certain terms; these users tend to @reply back with thanks or engage in conversation.
I’ve noticed a lot of new related followers, e.g. developers and programmers, so all in all the script has been pretty useful for me. The reason this has worked is that I’ve selected my keywords and hashtags accordingly, rather than blanket spamming random unrelated tweets. I’m looking to build on it and create a simple web app others can sign up and use also.
You need to be careful with this, as if not used honestly but in a spammy manner, there could be consequences; however, you could eliminate the build-up of favourites by writing another script that loops over your favourites list and simply calls the API’s
So first off we need a way to search for tweets. We set up the Twitter API with keys (which you’ll need to get from their developer site first).
1 2 3 4 5 6 7 8 9
And we create a function that hits the search endpoint.
Here’s an example of some of the data you can get. The tweets are all under the key ‘statuses’ and contain the important tweet ‘id’.
1 2 3 4 5 6 7 8 9 10 11 12
Riveting tweets I’m sure you’ll agree.
Next we create a function that favourites a tweet and plug that into a function that searches and the loops over the results and favourites each tweet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
favorites_create() we try to catch the exception that is thrown when you favourite an already favourited tweet (this happens a lot for retweets). For
search_and_fav() we store some useful tweet id’s that could be used for the
max_id param and also count how many successful favourites we create.
Here’s a gist of the full code:
And you can run it like so:
1 2 3 4 5 6 7 8 9 10 11
EDIT: The title of this post has been changed from Organically increase your followers with the Twitter API and a little Python.