PyCon UK

Registration Office

Building a Twitter Bot

Lessons learned from using DEFRA data to build a Twitter Bot

Hannah Sewell

Sunday 16th, 10:30 (Assembly Room)


A talk (25 minutes)

Twitter is over run with bots, so why not add your own? Twitter bots make up an estimated 15% of accounts on twitter partly because they’re so easy to make. As a beginner python learner, finding a project that was challenging but also manageable by myself was difficult, but twitter and defra air pollution data provided the perfect answer. I built a twitter bot that takes the air pollution every hour from the DEFRA API, processes it and tweets it.

Building a twitter bot required learning about APIs, processing data, json, dictionaries and docker. I learned a lot about programming, but I have also learned a lot about air pollution in Sheffield City Centre, it’s changes over time, and what causes spikes and troughs.

In this talk I’ll discuss using the package tweepy to build a bot and how I learned about APIs, JSON, dictionaries and docker along the way. I’ll also discuss the DEFRA air pollution data, how you can access your local data and why the air pollution API documentation from DEFRA is awful for beginners.


  • The speaker suggested this session is suitable for new programmers.

Back to schedule