sagarkarira / coronavirus-tracker-cli

Track conronavirus cases from command line. curl https://corona-stats.online/
https://corona-stats.online/
944 stars 81 forks source link

Remove HTML code when called from curl #53

Closed Jiab77 closed 4 years ago

Jiab77 commented 4 years ago

Hello, I really love your project but the recent changes made it unuable with curl.

Is it possible to remove the HTML when call from curl? Is can be done easily by reading the user-agent header.

Thanks for your work.

sagarkarira commented 4 years ago

@Jiab77 This is happening due to caching. Working on this.

Jiab77 commented 4 years ago

Thanks for this quick reply @sagarkarira ! I understand so let's keep this issue open till it's not fixed.

sagarkarira commented 4 years ago

Closing this, it was fixed here: https://github.com/sagarkarira/coronavirus-tracker-cli/commit/a921f609026dc9bc58796cd33ecf3eb2cf4d1268

Jiab77 commented 4 years ago

Thank you so much!

I can reuse it with curl and watch that way:

watch -n 600 "curl -Ss https://corona-stats.online/<country>"

Just add -c to handle ANSI color escape squences.

Useful for doing same with https://corona-stats.online/updates

Feel free to add that to your README. :wink: