From 5be27049e51080ff3acb42ae3cf1361f9fbfabeb Mon Sep 17 00:00:00 2001 From: emafazillah Date: Tue, 31 Mar 2020 13:11:03 +0800 Subject: [PATCH] Update README and configuration --- .github/workflows/send-message.yml | 5 +- README.md | 212 ++++++++++++++++++++++++++++- index.js | 2 - package.json | 1 - 4 files changed, 214 insertions(+), 6 deletions(-) diff --git a/.github/workflows/send-message.yml b/.github/workflows/send-message.yml index d2f49a1..9375484 100644 --- a/.github/workflows/send-message.yml +++ b/.github/workflows/send-message.yml @@ -1,4 +1,4 @@ -name: 'GitHub Action for COVID-19 Updates' +name: 'GitHub Action for COVID-19 Update' on: push: @@ -19,3 +19,6 @@ jobs: env: TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + URL: 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/' + CSV: '.csv' + COUNTRY: 'Malaysia' diff --git a/README.md b/README.md index 1cbd0f2..e85c064 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,210 @@ -# Covid-19 Updates Bot -Get Malaysia Covid-19 Updates. Data from 2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository by Johns Hopkins CSSE, https://github.com/CSSEGISandData/COVID-19. Updates will be sent via Telegram. +# Covid-19 Update Bot +## Description +Get Covid-19 Update by country. Data from 2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository by Johns Hopkins CSSE, https://github.com/CSSEGISandData/COVID-19. Update will be sent via Telegram. + +## Example Usage +```YAML +on: + push: + schedule: + - cron: '0 12 * * *' + +jobs: + bot: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: 'Install node' + uses: actions/setup-node@v1 + - name: 'Install NPM dependencies' + run: npm install + - name: 'Run code' + run: node index.js + env: + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + URL: 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/' + CSV: '.csv' + COUNTRY: 'Malaysia' +``` +## Country +Country | +:---| +Afghanistan +Albania +Algeria +Andorra +Angola +Antigua and Barbuda +Argentina +Armenia +Australia +Austria +Azerbaijan +Bahamas +Bahrain +Bangladesh +Barbados +Belarus +Belgium +Belize +Benin +Bhutan +Bolivia +Bosnia and Herzegovina +Botswana +Brazil +Brunei +Bulgaria +Burkina Faso +Burma +Cabo Verde +Cambodia +Cameroon +Canada +Central African Republic +Chad +Chile +China +Colombia +Congo (Brazzaville) +Congo (Kinshasa) +Costa Rica +Cote d'Ivoire +Croatia +Cuba +Cyprus +Czechia +Denmark +Diamond Princess +Djibouti +Dominica +Dominican Republic +Ecuador +Egypt +El Salvador +Equatorial Guinea +Eritrea +Estonia +Eswatini +Ethiopia +Fiji +Finland +France +Gabon +Gambia +Georgia +Germany +Ghana +Greece +Grenada +Guatemala +Guinea +Guinea-Bissau +Guyana +Haiti +Holy See +Honduras +Hungary +Iceland +India +Indonesia +Iran +Iraq +Ireland +Israel +Italy +Jamaica +Japan +Jordan +Kazakhstan +Kenya +Korea, South +Kosovo +Kuwait +Kyrgyzstan +Laos +Latvia +Lebanon +Liberia +Libya +Liechtenstein +Lithuania +Luxembourg +Madagascar +Malaysia +Maldives +Mali +Malta +Mauritania +Mauritius +Mexico +Moldova +Monaco +Mongolia +Montenegro +Morocco +Mozambique +MS Zaandam +Namibia +Nepal +Netherlands +New Zealand +Nicaragua +Niger +Nigeria +North Macedonia +Norway +Oman +Pakistan +Panama +Papua New Guinea +Paraguay +Peru +Philippines +Poland +Portugal +Qatar +Romania +Russia +Rwanda +Saint Kitts and Nevis +Saint Lucia +Saint Vincent and the Grenadines +San Marino +Saudi Arabia +Senegal +Serbia +Seychelles +Singapore +Slovakia +Slovenia +Somalia +South Africa +Spain +Sri Lanka +Sudan +Suriname +Sweden +Switzerland +Syria +Taiwan* +Tanzania +Thailand +Timor-Leste +Togo +Trinidad and Tobago +Tunisia +Turkey +Uganda +Ukraine +United Arab Emirates +United Kingdom +Uruguay +US +Uzbekistan +Venezuela +Vietnam +West Bank and Gaza +Zambia +Zimbabwe \ No newline at end of file diff --git a/index.js b/index.js index 93d107c..ed10746 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ require('dotenv').config(); const core = require('@actions/core'); -const github = require('@actions/github'); const { StringStream } = require('scramjet'); const request = require('request'); const Telegram = require('node-telegram-bot-api'); @@ -55,7 +54,6 @@ try { }); const message = generateMessage(COUNTRY, totalConfirmed, totalDeaths, totalRecovered, totalActive); - // console.log('message: ', message); bot.sendMessage(process.env.TELEGRAM_CHAT_ID, message); }); diff --git a/package.json b/package.json index 7e6778d..ea0a6c9 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "homepage": "https://github.com/emafazillah/covid19-updates-bot#readme", "dependencies": { "@actions/core": "^1.2.3", - "@actions/github": "^2.1.1", "dotenv": "^8.2.0", "node-telegram-bot-api": "^0.40.0", "request": "^2.88.2",