Skip to content

comster/covid19_stats

Repository files navigation

Covid-19 Stats Bot

This is a demo project that will automatically post Covid-19 stats to mastadon (toot).

Website | Tweets @corona19_stats | toots @covid_stats@mastodon.cloud

GitLab | GitHub

1) Automated toots

Using the code example from my quick_toot project, we will setup automated tooting of text and an image.

2) Create our node.js project

  • Create index.js
  • Create package.json

3) Fetch Covid stats

From this API, we will grab the latest coronoa stats.

4) Render a Pie Chart

Using the stats fetched, let's create a pie chart using D3, rendered using canvas

5) Schedule to run every day with GitLab

Using gitlab CI/CD, let's schedule this to run every day for our project

  • Create .gitignore
  • Create Dockerfile
  • Create .gitlab-ci.yml
  • Git Push
  • Setup schedule

6) Line chart showing 7 day moving average of both deaths and cases

  • Parse historical data into 7 day moving average
  • Render into multi-line chart for both deaths and cases
  • Include dependancies for headless chrome in docker

7) Line chart

  • 7-day rolling average
  • Deaths
  • Cases
  • 2 y axis labels
  • Color coated

8) Deployment docker deps

  • Chrome headless docker deps
  • GitLab CICD

9) Region / Locations

  • Countries
  • US State

10) Subscriptable

  • On each run, via Mastodon
  • Look through latest notifications to me (limit 50)
  • If notification msg is @me and has "sub" / "unsub"
  • Look at the toot it was in reply_to - Grab region code after "#covid_"
    • Add the user to a mastodon list (and follow them first) by the name of the country code
  • If no reply_to, check for #code
  • While generting toots for each region
  • Check if we have a list by that region name, grab it's users
  • Add them into the toot msg as @

TODO

  • Chart moving average
  • Regional stats (Countries & US States)
  • Tweet
  • Static website
  • ? Subscribe to hashtag
  • https://botsin.space/auth/sign_up
  • Fix region names (states) with spaces in them for URL's (encode spaces)
  • Hide American Somoa
  • ? Reduce the number of places tooted
  • Add vaccine data
  • Consider showing vaccine data as % of population
  • Fix sort of countries by name instead of code
  • Email notifications
  • Orbit db https://github.com/orbitdb/orbit-db

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published