What this is
Source code for bot powering Telegram Channel.
Data sourced from https://doh.gov.ph/covid19tracker.
Inspired by the good work being done over at PH Coronavirus Updates.
What it does
- Download Read me from data drop
- Parse links from read me
- Download Testing Aggregates csv from links
- Collate
daily_output_unique_individuals
anddaily_output_positive_individuals
grouped by provided date from csv - Send message to telegram
Requirements
- go 1.0+
config.json
file
-
Sample:
{ "telegram":{ "chat_id":"", "bot_id":"", "url": "https://api.telegram.org" }, "gdrive":{ "api_key":"", "url": "https://www.googleapis.com/drive/v2/files", "test_substring": "Testing Aggregates.csv", "link_substring": "bit.ly/", "readme_substring": "READ ME FIRST", "daily_url": "http://bit.ly/DataDropPH" } }
-
Instructions here for setting up a telegram bot.
-
Instructions here for enabling Google Drive API
Building
go get -d
go build
Running
./covidphtesttracker \
-d 2021-02-12 \
-l https://drive.google.com/drive/folders/1x-zy7hTT19cJ9Hin1B0WYrJksrTI6EU4 \
-c config.json
Flags
-c
: Path to config.json file-d
: Date to check