Jeremy Bernier

Hacking Twitter (how I got 1,000 followers in one week)

December 07, 2014

Last night I was bored and looking for a side project to work on to help improve my Javascript skills for my new job (just finished week 1), so I made a Twitter bot.

I had about 66 followers yesterday. As of writing this, I have 208 (@jeremybernier).

Going in I couldn’t have cared less about my number of Twitter followers. I don’t tweet that much and am not trying to sell or advertise anything. But after seeing how effective the bot was from the get go, it quickly got addicting. It was like being a kid again writing scripts to bot my Runescape account, except now this is real life. But now I’ve hit the daily follow limit (though I could still favorite tweets if I was particularly ambitious).

I had read a decent amount of personal accounts from entrepreneurs touting the effectiveness of Twitter marketing, and my short experiment has only reinforced this.

I typically get 0 traffic to this site, maybe a couple hits if I’m lucky. Yesterday I got 23. Is that a lot? No. But this blog isn’t even directly linked in my profile. Even more interesting is the fact that I’ve gotten actual non-automated responses from people - in the form of direct messages and tweets. Pretty cool given that I’m just an average dude. I could see this being very useful for networking and even job hunting.

As for how I built the bot - I used Node.js and the twit library. It was extremely simple to make because Twitter’s API let’s you do practically everything and is well documented.

My strategy revolved around targeting tweets with certain keywords and auto-following and/or favoriting them based on some simple logic used to eliminate users unlikely to follow me back. For example, I wouldn’t follow anyone who’s following/followers ratio was too low.

I also wrote scripts to automatically unfollow people who aren’t following me back (either because it’s been too long, or because they’re actively tweeting and thus obviously not going to follow back).

Results

Sunday (end of day): 208 followers

Monday: 304

Tuesday: 441

Wednesday: 571

Thursday: 809

Friday at 11:24am: 854, Friday end of day: 1,035

Saturday: 1,232

And then I got suspended from writing to the Twitter API.


Here are some jQuery scripts that don’t involve the API. You can run them in the developer console in your browser.

Unfavorite tweets

$('.ProfileTweet-actionButtonUndo.u-linkClean.js-actionButton.js-actionFavorite.js-tooltip').click();

Remove users you’re following who aren’t following you back

var list = $('.ProfileCard-content');
for (var i=0; i < list.length; i++) {
  if ($(list[i]).find('.FollowStatus').length <= 0) {
    $(list[i]).find('.user-actions-follow-button.js-follow-btn.follow-button.btn.small.small-follow-btn').click();
  }
}

Jeremy Bernier

Written by Jeremy Bernier who left the NYC rat race to travel the world, work remotely, and make the world a better place.