Skip to content

weareblahs/covidcases

Repository files navigation

Tip

(Please note that if you see this on https://weareblahs.github.io/covidcases, that means that the website isn't ready yet. Refresh in a minute.)

See the screenshot of the website by expanding this

Yes. This is how the website looks like. Nothing more, nothing less. Just the numbers.

What's This?

This is a no-nonsense, straight-to-the-point page which shows only the new cases of COVID-19 in Malaysia.

Data included

  • COVID-19 Cases

  • COVID-19 Deaths

Technical specs?

Uses GitHub actions for all the processing with the batch scripts, which replaces the No data string (and date string) in the HTML file to the latest cases.

Other projects / stuffs used in this project

  • samleong123/COVID-19-Malaysia-API (API / API documentation) (Main source for data)

    • Data source based on MoH-Malaysia/covid19-public
  • jq (used to parse JSON data)

  • sed (used to find and replace placeholders)

  • ImageMagick (used to generate images)

  • Helvetica Neue (used to generate images / website default font) (Version used)

  • add-to-homescreen (used for PWA "add to home screen" bottom pop-up when visiting website)

  • tweepy (used for Twitter bot updating)

App icon / Favicon

Credits to clipartpng.com for the original icon. Modified to mask the icon.

Website versions

There are 2 versions of this website:

  • Static version. This version contains a HTML file that auto-updates through GitHub Actions every 12 hours. Visit it here. (Available for both nationwide and states)

  • Realtime version. Your browser will contact the API every visit and use it to update the status. Refresh it to get new information. Visit it here. (Available for both nationwide and states)

Additional versions

  • Twitter version, which is available on @MYCovidCasesBot. Tweets the latest cases, along with images as a thread. Runs everyday 10am (MYT).

  • Mastodon version, which is available on @myccbot via botsin.space. Posts the latest cases, along with images as posts. Runs everyday 10am (MYT).

Data types

  • Nationwide

  • States

    • A list of states can be triggered by clicking / tapping the "More statistics" page.

Data availability

Data type Cases Deaths
Nationwide Yes Yes
State Yes Yes

Data sources

Data type Source
Nationwide samleong123/COVID-19-Malaysia-API (hosted by @samleong123, documentation)
States samleong123/COVID-19-Malaysia-API (hosted by @samleong123, documentation)

Save as image

After generating HTML pages, it will generate images with the current cases / deaths numbers through ImageMagick, which are also used for social media integration. To save it, go to the website, then click / tap on "Save as image".

Social Media Integration

An image of cases should be popped up if you share this website on Facebook or Twitter when you put this URL (https://weareblahs.github.io/covidcases ).

  • Same thing as the Deaths one, but only when you put https://weareblahs.github.io/covidcases/deaths as URL.

Dark mode

If you enabled dark theme on systemwide settings, then you should get dark mode when visiting this page on your device. Should be working on most modern browsers (Tested browsers including Chronium-based ones and Safari).

Automation (updating cases)

This page will update every hour.

Run with GitHub Actions under your own repository

Fork it, then run the "Update cases" workflow under Actions.

Run locally (for Linux-based computers)

First, make a copy or clone the repository if you haven't did that yet.

Before you run

Make sure you have the presiqutes installed.

sudo apt-get install jq imagemagick

Start updating

First, update the cases:

chmod +x update.sh
./update.sh

Then, update the state cases:

chmod +x updatestate.sh
./updatestate.sh

After you run?

Please note that if you want to host this in your web server, do note that the root directory of this repository is the root directory of the website itself. If you want to visit locally, you can just directly open index.html.

Future plans

(currently no plans)

Incorrect data or "No Data"?

Create an issue describing your problem.