bibaldo / mmm-covid19 Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I've amended the statsDateCell.colSpan test, as per submitted patch for your consideration.
Warm regards
/H
Hi,
Is it just me or is anyone else experiencing the issue where the world wide stats are displayed X 2
Instead of 1.1 million I see 2.2 million.
Covid-19 displays at the top but no other data loads. Rapidapi.com displays data for world_total_stat and cases_by_country.
Startup
pi@MagicMirror1:~/MagicMirror/modules $ npm start
[email protected] start /home/pi/MagicMirror
DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
[2020-04-27 23:24:18.678] [LOG] Starting MagicMirror: v2.11.0
[2020-04-27 23:24:18.709] [LOG] Loading config ...
[2020-04-27 23:24:18.733] [LOG] Loading module helpers ...
[2020-04-27 23:24:18.749] [LOG] No helper found for module: alert.
[2020-04-27 23:24:18.965] [LOG] Initializing new module helper ...
[2020-04-27 23:24:18.968] [LOG] Module helper loaded: updatenotification
[2020-04-27 23:24:18.970] [LOG] No helper found for module: clock.
[2020-04-27 23:24:20.450] [LOG] Initializing new module helper ...
[2020-04-27 23:24:20.452] [LOG] Module helper loaded: calendar
[2020-04-27 23:24:20.455] [LOG] No helper found for module: currentweather.
[2020-04-27 23:24:20.458] [LOG] No helper found for module: weatherforecast.
[2020-04-27 23:24:20.468] [LOG] Initializing new module helper ...
[2020-04-27 23:24:20.470] [LOG] Module helper loaded: MMM-COVID19
[2020-04-27 23:24:20.471] [LOG] All module helpers loaded.
[2020-04-27 23:24:20.921] [LOG] Starting server on port 8080 ...
[2020-04-27 23:24:20.987] [LOG] Server started ...
[2020-04-27 23:24:20.993] [LOG] Connecting socket for: updatenotification
[2020-04-27 23:24:20.998] [LOG] Connecting socket for: calendar
[2020-04-27 23:24:21.002] [LOG] Starting node helper for: calendar
[2020-04-27 23:24:21.005] [LOG] Connecting socket for: MMM-COVID19
[2020-04-27 23:24:21.009] [LOG] Starting node helper for: MMM-COVID19
[2020-04-27 23:24:21.012] [LOG] Sockets connected & modules started ...
[2020-04-27 23:24:21.361] [LOG] Launching application.
[2020-04-27 23:24:27.463] [LOG] Create new calendar fetcher for url: http://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics - Interval: 300000
[2020-04-27 23:25:07.913] [LOG] Shutting down server...
[2020-04-27 23:25:07.923] [LOG] Stopping module helper: updatenotification
[2020-04-27 23:25:07.927] [LOG] Stopping module helper: calendar
[2020-04-27 23:25:07.930] [LOG] Stopping module helper: MMM-COVID19
config
{
module: "MMM-COVID19",
position: "top_left",
config: {
updateInterval: 300000,
worldStats: true,
delta: true,
lastUpdateInfo: true,
countries: [ "Argentina", "China", "Italy", "Spain" ],
headerRowClass: "small",
rapidapikey: "e99ae7dff7msh8b3a800f28e7d00p173351jsnd1b85b148dc4"
}
},
how to add this info?
and use cases_by_country and worldstat endpoints
i see the URLs but haven't been told how to add those
Hello,
I followed the instructions and also obtained the rapidapi key successfully. The test endpoints are also a success. However the data is not being displayed on the screen. There is no compilation error on the config file. The rapid API dashboard shows a few api calls (total 8) and no errors, and avg latency of 431.63ms. The api calls shown must be when i tested the endpoints. But when i am running the magic mirror module the api calls are probably not coming thru.
How to verify if everything is alright.
SOLVED
In the config.js i had entered the module as "MMM-Covid19" (in small letters), whereas it should have been " MMM-COVID19"(capital letters). Silly mistake.
Thanks
Hi! I have installed the module under modules and added to the magic mirror config.js
{
module: "MMM-COVID19",
header: "COVID19",
position: "top_left",
config:{
countries: ["Austria", "Sweden", "China", "Spain", "Italy"],
delta: true,
worldStats: true,
updateInterval: 60 * 60 * 1000,
infoRowClass: "small",
headerRowClass: "small",
rapidapiKey: "50825f4524msh8e969ba*****************"
}
},
Of course I have a key but I just wanted to hide it.
But the module is now showing in the mirror. I have several modules that are working.
I guess that I am missing something.
Best regards Gökberk
Would be nice to be able to see both countries and specific US States!
This module isn’t working anymore on my mm. I didn’t do an update, it stops working from one day to the other??? Is this module working? Is the app basically not working anymore or do I have another problem?
{
module: "MMM-COVID19",
position: "top_left",
config: {
updateInterval: 300000,
worldStats: true,
delta: true,
lastUpdateInfo: true,
countries: [ "South-Korea", "China", "Italy", "Spain" ],
headerRowClass: "small",
rapidapiKey : "705fc0bb2fmsh4201f7c9bb9a89cp1a25a0jsna36534595cdb"
}
},
this is what I have for config.js and it doesn't work. I've also tried
"Korea"
"south_korea"
any help would be appreciated, thank you!
(Very low prio, it's cosmetic only)
When lastUpdateInfo is set to true, and delta is set to true,
statsDateCell.colSpan should be 7 instead of 5.
High, thanks for the module, its great.
I happen to run into a font size issue where one module runs into another because of the large font.
The font of the header is changable, could the font of the numbers and countries be changeble too?
Thanks,
I'd love to help out, tomorrow, time for bed.
I installed MMM-COVID19 and after starting the config e get a blank screen. I'm using MagicMirror 2.18.0.
It seams that the request module that is deprecated is still being used.
I found this on the logs:
[03.03.2022 10:09.48.831] [ERROR] Whoops! There was an uncaught exception...
[03.03.2022 10:09.48.842] [ERROR] Error: Cannot find module 'request'
Require stack:
Hi. I am unable to view the stats .. Just shows the title "COVID-19"
please check my config code and assist. where am I going wrong?
{
module: 'MMM-COVID19',
position: "bottom_right",
config: {
updateInterval: 300000,
worldStats: true,
delta: true,
lastUpdateInfo: true,
countries: [ "India", "USA", "China" ],
headerRowClass: "small",
rapidapiKey: "0bc8b48ef2mshe92****************************0109c8f" // this is an example, do not try to use it for real
}
},
After updating to the latest version the module isn't visible anymore. I already deleted the module completely and installed it again.
Error in the log:
[15:35:03.466] [ERROR] ERROR! Could not find main module js file for images
{
module: "MMM-COVID-19",
header: "COVID-19",
position: "top_left",
config:{
countries: ["Germany", "Austria", "Spain","Italy"],
worldstats: true,
updateInterval: 1000 * 60 * 60 * 6,
headerRowClass: "small",
rapidapiKey: "!secret"
}
},
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
audited 220 packages in 10.423s
found 8 vulnerabilities (7 low, 1 high)
run npm audit fix
to fix them, or npm audit
for details
[email protected] postinstall /home/pi/MagicMirror
sh untrack-css.sh && sh installers/postinstall/postinstall.sh && npm run install-fonts
MagicMirror installation successful!
[email protected] install-fonts /home/pi/MagicMirror
cd fonts && npm install
audited 1 package in 1.076s
found 0 vulnerabilities
audited 2766 packages in 56.338s
43 packages are looking for funding
run npm fund
for details
found 25 vulnerabilities (23 low, 2 moderate)
run npm audit fix
to fix them, or npm audit
for details
Any ideas?
Hi! I have installed the module under modules and added to the magic mirror config.js
{
module: 'MMM-COVID19',
config: {
updateInterval: 30000,
worldStats: true,
//countries: [ "USA", "Italy", "Spain" ],
headerRowClass: "small",
rapidapiKey : "b82151b3d5msh55f3629c1a9MY -rapidapi-KEY*****"
}
},
But the module is now showing in the mirror. I have several modules that are working.
also I con not see position config in your setup like: ( position: "top_left", )
I guess that I am missing something.
Best regards Pierre
Excellent work! Are the columns configurable now? Looks like the JSON currently has some other interesting columns to show potentially (e.g. new cases/new deaths). Thanks!
Hello,
can you please tell me how to change the code to get this Module running with the "covid19-monitor-pro" API? I think this is the Freemium Version of the Covid19-monitor.
I'm unsure of "You should first create an account on https://rapidapi.com/ and then go to https://rapidapi.com/astsiatsko/api/coronavirus-monitor, and use cases_by_country and worldstat endpoints" I did go and got an API key and added it, but I couldn't add cases_by_country AND worldstat that I can see to a single request. Sorry if I'm missing something...
Additionally, my config entry is:
{
module: "MMM-COVID19",
config: {
position: "top_left",
header: "COVID-19 Tracker",
countries: ["USA"],
worldStats: "true",
lastUpdateInfo: "true",
delta: "true",
highlightCountry: "USA",
headerRowClass: "small",
infoRowClass: "small",
updateInterval: "1500000",
rapidapiKey: "37d6fa675ab4107...............CHANGED_FOR_POST"
}
},
Hey. How do you pull the total global stats? I’ve tried global, world, etc to no avail
I'm not a css guy, so I'm hoping someone can help me to get the grid a bit more compact.
Hello,
I'm using MagicMirrorOS 2021-03-04-magicmirroros-buster-armhf-lite-0.2.0 and trying to do a clean install of my magic mirror. Each time I do a "git pull" update into an old backup image of my install or "git clone etc" of the module into a clean install the entire mirror goes blank. I've been able to recreate this on a RPi 3B, 3B+, 4B 2gb, and 4B 8GB using different SanDisk, Samsung, and Microcenter MicroSD cards.
here's my modules info from config.js:
{
module: "MMM-COVID19",
position: "bottom_right",
config: {
updateInterval: 300000,
worldStats: true,
delta: true,
lastUpdateInfo: true,
highlightCountry: "USA",
countries: [ "USA", "China", "Mexico", "India", "Spain", "Russia", "Canada", "Australia", "England" ],
headerRowClass: "small",
infoRowClass: "small",
rapidapiKey : "a09c0dded6mshdc******************************************"
}
},
Please let me know which log file out put you need or anything else.
Is there a modification to pull data from the UK?
hello,
Is it posibile to have the Numbers of Europ?
Instaed the Numbers of the word?
Or can i put europ in the countries
at the end of the page, the author says to use the endpoints from the API page but doesn't explain where they are to go. If anyone can help me out or show me anything I may be missing, I would really appreciate it!
URL:
https://rapidapi.p.rapidapi.com/coronavirus/cases_by_country.php
https://rapidapi.p.rapidapi.com/coronavirus/worldstat.php
Header
X-Rapidapi-Host: coronavirus-monitor-v2.p.rapidapi.com
I have changed those values in node-helper.js and it works fine ;-)
Thanks for translating the module. Can I be helpful in any way to translate the names of the countries?
Hello,
sorry if this is a really dumb question but I couldn't find the answer.
I "think" I configured it correctly because there is no error in the config (the line covid is displayed on the mirror), but there is nothing below it. on rapiapikey I got a x-rapid-key I copied in the config file ...
How can I debug or see where it fails ?
Thanks
Hi
I have been trying to change the language by adding getTranslations to the config without luck :(
I have also added a danish translation, but I cannot commit it, so I have attached it here hoping that @bibaldo will see it and add it
Thank you.
Hello,
After 4 days I can say the data are not refreshed for all countries in my list.
I mean the "delta" data.
Only the first country is refreshed and world datas.
I've monitored datas from 3 different sources yo compare before sending this issue.
Can source of datas can be changed ?
Thank you.
Hey Bibaldo,
Great plugin! I've been using it and adding some stats myself in the last weeks.
I see you've already added new deaths and new cases but there is one more stat the api provides.
The "serious" cases indicating the amount of people on intensive care. (great info to check against available icu beds of the country) It's only available on country level.
I've already added it to my code in order to show it, might be something you can add to the distro yourself? That way I don't have to update & redo my edit every time you update ;)
Much appreciated!
Hi,
Is it possible to change this to use https://thevirustracker.com/api#CountryTotals as Rapid API seem to have changed the service to a paid service?
You could use the following for country stats:
https://api.thevirustracker.com/free-api?countryTotals=ALL
And the below for world stats:
https://api.thevirustracker.com/free-api?global=stats
Please add French translation (see attached file)
fr.json.txt
Could we see support for the united_states_cases endpoint? It would be nice to list individual states along with the countries.
Hi!
Magnific addon ;)
Can you add related refresh date info?
Hey there,
there is a spelling error in the french translation file.
Please replace on line 7 : "Gérisons" with "Guérisons"
Sorry for this note and thank you for the work.
Hi,
I found a small syntax error towards the Cases Per M translation in the MMM-COVID19.js @ line 114
old : headerCasesPerMCell.innerHTML = this.translate('Cases per M')
new : headerCasesPerMCell.innerHTML = this.translate('Cases Per M')
Cheers & stay safe,
B
I was wondering if there is a way I can customize this to show data in Eastern Standard Time? Is it as simple as making a change in my config file?
Thanks!
Right now China has 81.340 cases, USA 85.749, Italy 80,589.
But it lists them in the order China - USA - Italy.
hi
i tried to follow instructions but i am unable to view the stats. i might just be misssing anything. below is my code from config.js
// COVID-19
{
module: 'MMM-COVID19',
config: {
// updateInterval: 300000,
// worldStats: true,
//countries: [ "USA", "India", "China", "Italy", "Spain" ],
//headerRowClass: "small",
rapidapiKey : "c2fcb164776914" // edit the key on purpose
}
},
Great little infobox!
Just a couple of ideas:
Personally I don't like having too much colour on my display so having the option to turn colour on and off would be great.
Also column/row separators could look quite neat - just lines down or across to group things together.
...it would help putting the total number of confirmed cases in context.
E.g. Italy has 1.330 confirmed cases per 1M population, whereas USA sits at 259. # #
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.