Hashbot: A Twitter Bot For Hashnode Articles #christmashackathon

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article


For the Hashnode Christmas Hackathon, I decided to build a Twitter bot that does two things -

  • Retweet every tweet with the following keyword in itself -
    • Hashnode
    • HashnodeCommunity
    • HashnodeBot
  • Reply with the requested article when mentioned in a tweet.

    • Tweeting

      @HashnodeBot featured

      will get you a reply from the bot with today's two featured articles.

    • Tweeting

      @HashnodeBot [n]

      will get you a reply from the bot n last articles from the specified user.


On December 28, Morning I started the project, I had never created a bot before so I searched google and learned about Tweepy) and how to use it.

Tweepy is a Python library for accessing the Twitter API.


Now, was the time to decide how I will achieve the two requirements -

  • Retweeting tweets with concerning keywords.
  • Replying with Hashnode articles as demanded by the user.

The first task was easy and direct to do with Tweepy, I just had to write a simple Python script that waits for new tweets with given keywords and then retweet and like them if not done yet.

The second task required me to use both Hashnode and Twitter API, the idea was to read tweets that mention the bot @HashnodeBot and then using the Hashnode API get those tweet, but the problem was Hashnode uses GraphQL and I didn't understand it, So I gave a quick look to GraphQL documentation and figured out how to use it. (It was not that hard though πŸ˜…).


I wrote two python scripts for this task, one fetches articles using hashnode API, and the other replies to the tweet with Bot's mention.


Here is how Retweet Bot looks like on Twitter -


and this is how Reply Bot looks like on Twitter -




For some reason, Twitter was not showing the replies from the bot to other users, only the reply count is increasing and the replies are visible from the bots account only.

Twitter was restricting the visibility of the Bot

I tried to get around this, searched Google but couldn't make it, The only reason I got is that Twitter spam filtering was responsible for this, so I decided to deploy the bot with only the retweet feature.


I used Docker to deploy the bot on AWS, this was my first time with both Docker and AWS.

I also used the scp command for the first time to transfer the docker package to AWS.

Final Result

So, in the end, I created and deployed a Twitter Bot that retweets tweets with the following keywords - Hashnode, HashnodeCommunity.

In the first 24 hours of deployment, the bot has retweeted over 100 hashnode tweets.

You can follow the bot @HashnodeBot to stay updated with all the amazing articles on hashnode and support the writers.

Here are the resources I used in this project

Thanks For Reading

If you find this article and project helpful, please like and share, and leave your feedback in the comments, It means a lot. πŸ™πŸΌ

You may also like:

Sunayna Padhye's photo

Impressive insights of building a twitter bot.

Yuvraj Singh Jadon's photo

Thanks, Sunayna 😊

Vamsi Rao's photo

Great work, just tweeted and it worked like a charm! Would love to read more on

I used Docker to deploy the bot on AWS, this was my first time with both Docker and AWS.

Yuvraj Singh Jadon's photo

Thanks So Much 😊

About Docker and AWS, I followed the mentioned Realpython guide. First, I created an image for the bot and then deployed it on the EC2 t2.micro instance of AWS. While deploying I used ssh to connect to the remote instance and scp to transfer the docker image.

Docker and especially AWS is a little new to me, I hope to learn more about these soon.

Jacqueline Allen's photo

Very creative blog!!! I learned a lot of new things from your post. It is really a good work and your post is the knowledgeable. Waiting for your more updates.. Want to Learn to how type faster and want to find out how fast you can type? then visit my profile typingspeedtest and use my software. This will give you your typing speed and accuracy.