Write a Twitter Bot in 5 Minutes – Thnxz to @labnol – Amit Agarwal


Meet @DearAssistant, a Twitter bot that is like a mini version of Siri. You can tweet your questions in plan English and the bot will reply with an answer.

The Twitter bot is internally using Wolfram Alpha so there’s a whole range of questions that it can answer. Here are some questions that people have asked @DearAssistant so far:

  • How many calories are in Diet Coke? (link)
  • When was Mahatama Gandhi born? (link)
  • What is the distance between city A and city B (link)
  • Who directed the film M (link)
  • What is the price of Kindle Paperwhite (link)

Twitter Bot

You can also ask the bot for word meanings, weather conditions, language translation, to convert between time zones, date calculations (how many days until Christmas) and more.

Writing a Twitter Bot – The Basic Ingredients

Writing a Twitter bot is surprisingly simple and you can get one up and running in 5 minutes. It helps if you know little bit of coding (simple JavaScript) but that’s certainly not a requirement for writing a basic Twitter bot.

A bot is essentially a program that is always running in the background and whenever it encounters a command (tweets in this), it processes it (based on the text of the tweeet) and sends a reply to the tweeter in another tweet.

Earlier, you would need a web server to run the bot while the bot itself would be written in languages like PHP, Perl or Python. That’s complicated so we will use Google Scripts to write the Twitter bot and host it on our Google Drive.

How to Write a Twitter Bot – Step by Step
Full article? H e r e 🙂

Anuncios

Autor: Gabriel Catalano - human being | (#IN).perfección®

Lo importante es el camino que recorremos, las metas son apenas el resultado de ese recorrido. Llegar generalmente significa, volver a empezar!