Skip to content

Python script that implements a bot that chooses two elements from a database and picks a winner until there is only one left. Results are posted to twitter including an image with the list and status of the elements.

License

Notifications You must be signed in to change notification settings

ajerit/twitter-warbot

Repository files navigation

Twitter-Warbot

Python script that implements the simple Twitter Warbot that chooses elements from a list and selects a winner until there is just one element left.

  • Player list is stored in Postgresql DB, uploaded from a text file with the upload_name.py script. DB stores data like status, win count, death and select probability per player.

  • The Bot selects two items from the DB, based on the select probability, and then chooses one to "die" based on death probability.

  • Using PIL library a image is generated with all the items on DB with their current status ("Dead" items are shown with red strikethrough.

  • The generated image and the corresponding selected items are sent to the Twitter API to be posted by the Bot account.

  • Config.py contains helper methods to connect to DB, twitter API and other services

  • csibot.sql contains the schema for the DB

About

Python script that implements a bot that chooses two elements from a database and picks a winner until there is only one left. Results are posted to twitter including an image with the list and status of the elements.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published