Skip to content

Experimental Twitter bot based on GitHub Actions and R

Notifications You must be signed in to change notification settings

codecreative/immunityunity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Immunity Unity

Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. immunityunity

Repo for the experimental Twitter bot @immunityunity.

Why?

The goal was to learn about Github Actions and set up a workflow using an R script. But it is better to learn with a project.

Concept

Only if we end the pandemic everywhere can we end the pandemic anywhere.

Max Roser (Our World in Data)

That quote inspired a wonderful project by David Bauer which has in turn inspired this one. I am applying the same idea to a single country, using vaccination data for the 50 US states. Each state is trying to complete its own circle based on the percentage of fully vaccinated people. No circle can truly be complete unless they all are.

Herd immunity thresholds for Covid-19 are only estimates at this point. But experts generally agree that somewhere between 70% and 85% of the population must be protected to suppress the spread, a range that Dr. Anthony Fauci, director of the National Institute of Allergy and Infectious Diseases has recently cited.

CNN

To fully complete a circle, the state must reach 85% vaccinated population. That may a stretch, but as it is the upper end of the range mentioned by Dr. Fauci, that is our target.

Images through March 14th have been done in a batch process looping through the dates. This project is running from March 15th, 2021. Hopefully automatically, but possibly with a slight nudge every now and then.

Data source

The data is compiled by Our World in Data, a small team doing big work. Please consider donating. You can find their covid vaccination data on GitHub.

Is this a data visualization?

Not exactly. It is flawed in that sense. For starters, the outside lines will be much longer than those on the inside for the same percentage. There are deliberately no labels to make it more abstract. It also goes along with the idea that we need all the circles to be complete so there is less focus on the individuals. Let's call it data art... using "art" in the loosest of definitions.

Tech

This repo contains a GitHub Action that runs once a day - about 10pm UK time. It runs an R script that fetches the vaccination data, builds the graphic in ggplot2 and posts the result to @immunityunity on Twitter using {rtweet}.

There is an intermittent issue that can cause the action to fail. Seems to be when posting a media object through rtweet. It doesn't happen every time so it is difficult to break down the actual source of the problem.

This repo exists because of other people openly sharing their knowledge. I stole borrowed the GitHub action setup heavily from Matt Dray's londonmapbot and Matt Kerlogue's post on scraping PDFs to set up this project. I've added caching but need to research a little more to see if I've done it 100% correctly.

Design inspiration

A love letter to coord_polar() by Ijeamaka Anyene. I'm an R novice, so wasn't sure how to accomplish what I was aiming for. This was perfect and inspiring for many reasons. So much to learn here, definitely going to dig into the more complex examples.

For more circular inspiration, I recommend The Book of Circles by Manuel Lima and checking out some of Nadieh Bremer's work.

Special thanks

  • Simon Willison for his lightning talk at NICAR21 that piqued my curiousity into GitHub Actions and the possibilities for newsroom applications.

Related resources

About

Experimental Twitter bot based on GitHub Actions and R

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages