Share your repls and programming experiences

← Back to all posts
Coronavirus Tracker (Self-Updating) #FlattenTheCurve
SharpCodeDev (42)

This website automatically scrapes the most trusted coronavirus research websites and displays live information about world COVID-19 cases while updating by the second and maintaining a sleek design for mobile compatibility.

Commentshotnewtop
SharpCodeDev (42)

How one would think I made this: HTML, PHP, CSS, JavaScript...
How I actually made this:

JosephSanthosh (1179)

Umm, this is not working.

gwood5901 (4)

@JosephSanthosh I had to reload it many times to get it to work, not sure why the words don't show up the first time. Anyways, it works if you reload it enough times.

gwood5901 (4)

Great! Just a suggestion, the countries could be sorted by death count instead of alphabetical order.

[deleted]

Yes flatten the curve

FloCal35 (106)

You know what would be cool, if you had the Total (World) boxes follow the user as they scroll. Just an idea.

FloCal35 (106)

@SharpCodeDev man, I didn't know you would acctually do it.

SharpCodeDev (42)

@FloCal35 since it's a table, CSS doesn't seem to like position: sticky;, but I'm trying everything I can.

FloCal35 (106)

@SharpCodeDev Now worries, it was just an idea

DynamicSquid (3549)

This is the first time I've seen PHP code in my life

HermioneGrange2 (6)

@SharpCodeDev, Did this program use an API?

SharpCodeDev (42)

@HermioneGrange2 it did not, it used web scraping. If you are wondering from which website this information was obtained, the answer is https://ncov2019.live/data/world.

hello1964 (22)

How can the deaths, recovery, and confirmed all be the same number?

SharpCodeDev (42)

Hey everyone!

Feel free to ask questions/report bugs
about the website in this space. FAQ:

  • Does this website use an API? No, it scrapes
    https://ncov2019.live/data/world for this
    information.
  • Why is the text not showing up? This is
    a common issue. I have not found a way to
    prevent this from happening, but I know
    that the issue has something to do with the
    PHP.
AstOwOlfo (208)

Ur profile says u know node tho, why’d u pick php for this? @SharpCodeDev

SharpCodeDev (42)

@agent9002 ¯_(ツ)_/¯ easy web scraping (lines 230 - 233)

SharpCodeDev (42)

@AstOwOlfo also because it is hard to Node.js to work on a website, PHP is just more compatible.

AstOwOlfo (208)

if you cant handle react/next or smth then just use express ez, and wdym "php is more compatible"? @SharpCodeDev

DynamicSquid (3549)

@SharpCodeDev that is actually the cleanest webscrapping code I have ever seen!

JosephSanthosh (1179)

May I know which website the data is being transferred from? Or where this data is coming from?

JosephSanthosh (1179)

That is not a government or state controlled website, so it is better to stay to more reliable websites. @SharpCodeDev

oignons (308)

@SharpCodeDev Gonna have to agree with @JosephSanthosh here. Try using worldometers.info/coronavirus/ . Lots of state and government agencies use it, and it's updated every few seconds.

JosephSanthosh (1179)

Yea for once the onion agrees with me! @oignons

SharpCodeDev (42)

@JosephSanthosh Sure! Thank you for the idea.

oignons (308)

Great job! Maybe have different ways of sorting, e.g. by case count, death count, recovery count, etc. Also space out the tabs a bit, it is a bit cramped.

PS: How often does it update?

SharpCodeDev (42)

@oignons I had to remove the ability to self-update because it was causing critical issues. However, should I find a solution, the goal is to make it update every second.

Jeydin21 (24)


What does this mean?

SharpCodeDev (42)

@Jeydin21 that is an error in my PHP code. At this moment I am looking for a solution. The error is that the JavaScript and PHP are not interacting properly and some functions are not being called.

Jeydin21 (24)

@SharpCodeDev Oh. It's actually working right now! GG

SharpCodeDev (42)

@Jeydin21 about that... reloading the page will break it again. I don't know what's going on that is causing it to do that.

Jeydin21 (24)

@SharpCodeDev Probably the PHP thing. But that's a really cool project though. Keep it up!