All Projects → Bost → corona_cases

Bost / corona_cases

Licence: other
🦠 Coronavirus Information on Telegram Chatbot

Programming Languages

clojure
4091 projects
shell
77523 projects
emacs lisp
2029 projects

Projects that are alternatives of or similar to corona cases

vaccipy
Automatische Impfterminbuchung für www.impfterminservice.de
Stars: ✭ 548 (+2784.21%)
Mutual labels:  corona, covid-19
cwa-qr
Python Implementation of the CoronaWarnApp (CWA) Event Registration
Stars: ✭ 17 (-10.53%)
Mutual labels:  corona, covid-19
CoronaVirusOutbreakAPI
A tiny and small program to crawler and analyze outbreak of COVID-19 in world and every country using PHP.
Stars: ✭ 20 (+5.26%)
Mutual labels:  corona, covid-19
CovidAndroid
Android app to track and record COVID status. Mainly for Ethiopia
Stars: ✭ 18 (-5.26%)
Mutual labels:  corona, covid-19
Corona Cli
🦠 Track the Coronavirus disease (COVID-19) in the command line. Worldwide for all countries, for one country, and the US States. Fast response time (< 100ms). To chat: https://twitter.com/MrAhmadAwais/
Stars: ✭ 1,812 (+9436.84%)
Mutual labels:  corona, covid-19
coronavirus-dresden
Collects official SARS-CoV-2 infection statistics published by the city of Dresden.
Stars: ✭ 19 (+0%)
Mutual labels:  corona, covid-19
cli-corona
📈 Track COVID-19 (2019 novel Coronavirus) statistics via the command line.
Stars: ✭ 14 (-26.32%)
Mutual labels:  corona, covid-19
covid19-timeseries
Covid19 timeseries data store
Stars: ✭ 38 (+100%)
Mutual labels:  corona, covid-19
Cwa Server
Backend implementation for the Apple/Google exposure notification API.
Stars: ✭ 1,776 (+9247.37%)
Mutual labels:  corona, covid-19
COVID-19-AI
Collection of AI resources to fight against Coronavirus (COVID-19)
Stars: ✭ 25 (+31.58%)
Mutual labels:  corona, covid-19
CoronaApp
Real Time Corona App
Stars: ✭ 22 (+15.79%)
Mutual labels:  corona, covid-19
COVID-19-DETECTION
Detect Covid-19 with Chest X-Ray Data
Stars: ✭ 43 (+126.32%)
Mutual labels:  corona, covid-19
impfbot
Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal https://impfportal-niedersachsen.de
Stars: ✭ 37 (+94.74%)
Mutual labels:  corona, covid-19
covid-19-image-repository
Anonymized dataset of COVID-19 cases with a focus on radiological imaging. This includes images (x-ray / ct) with extensive metadata, such as admission-, ICU-, laboratory-, and patient master-data.
Stars: ✭ 42 (+121.05%)
Mutual labels:  corona, covid-19
coronainfobd
Real-time corona-virus tracker of Bangladesh 🇧🇩 which includes latest updates, data visualization, public awareness from WHO and some advice to aware people. 🥰❤
Stars: ✭ 46 (+142.11%)
Mutual labels:  corona, covid-19
COVID-19-STAT
A web application to keep track of COVID-19 numbers & growth across the world
Stars: ✭ 19 (+0%)
Mutual labels:  corona, covid-19
covid-19
A web application to display Coronavirus Diseases (COVID19) statistics from different countries.
Stars: ✭ 28 (+47.37%)
Mutual labels:  corona, covid-19
rcvr-app
recover provides localities a privacy-compliant, safe, and easy way for their guests to check in. See https://www.recoverapp.de/ for more details.
Stars: ✭ 43 (+126.32%)
Mutual labels:  corona, covid-19
covid
COVID-19 cases around the world.
Stars: ✭ 14 (-26.32%)
Mutual labels:  corona, covid-19
Api
API for Current cases and more stuff about COVID-19 and Influenza
Stars: ✭ 2,323 (+12126.32%)
Mutual labels:  corona, covid-19

Coronavirus disease 2019 (COVID-19) information on Telegram Messenger @corona_cases_bot

Raison d´être

The Internet interprets censorship as damage and routes around it.

  • John Gilmore

Screenshot Screenshot

TODO add monkeypox data: https://github.com/globaldothealth/monkeypox

Setup environment

Install

# on Ubuntu:
# The `sudo snap install heroku --classic` doesn't work on Ubuntu
# See https://github.com/heroku/cli/issues/822
curl https://cli-assets.heroku.com/install.sh | sh

# on Guix:
npm install -g heroku
sudo rm /usr/local/bin/heroku
sudo ln -s /home/bost/.npm-packages/bin/heroku /usr/local/bin/heroku
## on Ubuntu:
sudo apt install --yes postgresql postgresql-contrib
# TODO see the the proposition given by the installation process:
# You can now start the database server using:
#     pg_ctlcluster 13 main start
sudo systemctl status postgresql.service
sudo systemctl stop postgresql.service
pgdata=./var/pg/data
pglog=./var/log/postgres.log
mkdir -p $pgdata
sudo chmod --recursive u=rwx,g=rwx,o=rwx ./var/
sudo --shell --user=postgres
# when using fish shell:
set --export PATH /usr/lib/postgresql/*/bin $PATH
initdb $pgdata # dropdb postgres && rm -rf $pgdata
pg_ctl --pgdata=$pgdata --log=$pglog start
# see also: postgres --pgdata=$pgdata &

## on Guix:
pg_ctl --pgdata=$pgdata --log=$pglog start

Open new console and log in

# in case of:
#      psql: error: FATAL:  role "username" does not exist
#   sudo --user=postgres createuser -s <username>
# or:
#   createuser --shell postgres # on guix
psql --dbname=postgres # or:
# sudo -u postgres psql --dbname=postgres
\conninfo
-- list databases:
\l
\l+
SELECT datname FROM pg_database;

Create

Define local environment vars

Create .env in the project root directory and set the CLOJURE_CLI_VERSION:

echo \
"# See also .heroku-local.env

# The value must be one of `(keys corona.envdef/environment)`;
# lower-cased and not surrounded by the double quote chars \"\".
CORONA_ENV_TYPE=hokuspokus
# (keyword corona-cases)
# (keyword hokuspokus)
# (keyword \"local\")
# (keyword \"devel\")

# https://clojure.org/guides/getting_started#_installation_on_linux
CLOJURE_CLI_VERSION=0.0.0.0

PAPERTRAIL_API_TOKEN=\$PAPERTRAIL_API_TOKEN_HOKUSPOKUS
TELEGRAM_TOKEN=\$TELEGRAM_TOKEN_HOKUSPOKUS

# PAPERTRAIL_API_TOKEN=\$PAPERTRAIL_API_TOKEN_CORONA_CASES
# TELEGRAM_TOKEN=\$TELEGRAM_TOKEN_CORONA_CASES" > .env
./heroku.clj updateClojureCliVersion
heroku config --app <HEROKU-APP-NAME>
CLOJURE_CLI_VERSION:  ...
COMMIT:               ...
CORONA_ENV_TYPE:      ...
PAPERTRAIL_API_TOKEN: ...
REPL_PASSWORD:        ...
REPL_USER:            ...
TELEGRAM_TOKEN:       ...

Develop

  1. Get the test data and start the mockup data service Initially, copy the whole project to a separate directory:
cd ..
cp -r corona_cases/ corona_cases.data
cd corona_cases.data
  1. Repeatedly
./heroku.clj getMockData
clj -X:mockup-server
  1. Start the nREPL from the command line:
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.5.5"} cider/cider-nrepl {:mvn/version "0.28.3"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'

Then in Emacs M-x cider-connect-clj

  1. Start the telegram chatbot long-polling:
(require '[corona.telegram])
(corona.telegram/start)
  1. Start the web server:
(require '[corona.web])
(alter-var-root #'system component/start)

and check the http://localhost:5050/ if it's running.

Run locally

On PostgreSQL 13.3 no var/pg/postgresql.conf changes needed.

On PostgreSQL 13.6, in the var/pg/postgresql.conf:

  1. activate:
unix_socket_directories = '/tmp'  # comma-separated list of directories
  1. comment out:
# lc_messages = 'en_US.utf8'			# locale for system error message
# 					# strings
# lc_monetary = 'en_US.utf8'			# locale for monetary formatting
# lc_numeric = 'en_US.utf8'			# locale for number formatting
# lc_time = 'en_US.utf8'				# locale for time formatting
# start Postgres
pg_ctl --pgdata=./var/pg --log=./var/log/postgres.log start # on Guix
# pg_ctl --pgdata=./var/pg stop
bin/build; and heroku local --env=.heroku-local.env
# or:
# bin/build; and heroku local --env=.heroku-local.env --set COMMIT=...

Heroku CI pipeline

./heroku.clj deploy --heroku-env hokuspokus
# ./heroku.clj promote

MySQL -> PostgreSQL script conversion

sudo apt install postgresql postgresql-contrib
# Switch over to the postgres account:
sudo su postgres
createdb postgres # or: dropdb postgres

# psql --dbname=postgres         --echo-all --file=dbase/my.sql | rg "ERROR\|NOTICE|WARN"
# psql --dbname=postgres --quiet            --file=dbase/drop-everything.sql
psql --dbname=postgres   --quiet            --file=dbase/my.sql

# get the psql prompt:
psql --dbname=postgres

then

-- help
\?
-- list roles / show users
\du
-- list tables
\dt
-- list sequences
\ds
-- list indices
\di

Update

./heroku.clj updateClojureCliVersion
# like `lein ancient`
# see also https://github.com/practicalli/clojure-deps-edn
# clojure -Spom # generate the pom.xml
clojure -M:outdated --upgrade # --force

Others

# Inspect logfile:
# heroku plugins:install heroku-papertrail
heroku pt ":type -'ssl-client-cert' -'$MY_TELEGRAM_ID'" --app <HEROKU-APP-NAME> | grep -v -e '^[[:space:]]*$

# Inspect memory:
# sudo apt install visualvm
visualvm -J-DsocksProxyHost=localhost -J-DsocksProxyPort=1080 & disown

# get command line access
TODO it reads the .bashrc and/or .bash_profile HUH!
heroku run bash --app <HEROKU-APP-NAME>

# postgres database command line
heroku pg:psql --app <HEROKU-APP-NAME> <DATABASE>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].