/multidrugs_bot

Primary LanguagePythonMIT LicenseMIT

Drug-drug Interaction Twitter Bot

In this project I developed a Twitter bot that periodically tweets about possible interactions between common drugs. It also has the functionality to check if there is an interaction when the bot is mentioned (tagged) and two drugs are provided.

Drug interactions occur when a drug's mechanism of action is disturbed by the concomitant administration substances such as foods, beverages or other drugs.
- Wikipedia

Bot's characteristics

The bot is linked to the following account: https://twitter.com/multidrugsbot and was possible using the Twitter's Developer Platform.

pic

The bot was developed in python using primarly the Tweepy package to access the Twitter API.

The bot consumes the NIH API using the DrugBank database in order to retrieve drugs' ID and check possible interactions between them.

It is currently hosted in a Heroku server, configured to continually run using the Procfile.

Functionalities

Periodic tweet: Tweet the interaction between two common drugs. pic2

Interaction checker: Reply if there is an interaction between two given drugs. And like their tweet. pic3

Files

  • The multidrugs_bot.py is the main script that gives the bot its functionalities.

  • last_seen_id.txt is a text-based "database" which keeps track of the latest tweet's ID corresponding to the last tweet processed by the bot (so it no longer reply those tweets).

  • Procfile is a file needed to run the main script in the Heroku server.