🦠 CoronaVirus COVID-19 Statistics in TouchBar

You never mentioned you were using a Beta version of Mac OS. Monterey has been release today, same issues with full release? I wont be installing Monterey for some time, when I do, I will take a look.

Maybe the BTT dev. will know what the issue is, im sure he has been working a lot with the beta builds and BTT.

Here I mentioned about Monterey, but yes - same issue with full release.

I think there are some changes with how scripts work in Monterey ... BTT got uncountable updates (alphas included) and none of them does change anything in this case.

I hope its something that @Andreas_Hegenberg is able to resolve on the BTT end. If its something that causes changes in preset scripting, it will have to wait until I update MacOS or another user of my scripts compete the changes.

1 Like

Thank you very much for your help, I am sure we will fix this in the future. :+1:

For sure!

I’m not aware of any scripting changes in Monterey, I’d assume it has something to do with the API that’s being called.

Can you post the result of just running the curl portion of the command?

Possibly the command line tools have been upgraded to newer versions on Monterey, but it‘d be weird if they‘d behave differently now

curl https://covid19-cli.wareneutron.com/basic/USA -si | grep -m1 -A1 'Cases' | sed 's/ *Cases | //g' | sed 's/ Today.//g'

46,316,225
Returns correctly on my end running MacOS Big Sur, BTT 3.565

Returns this on my Monterey installation:

OK, so it does look like some scripting changes in Monterey.

Should this return something different? (Sorry I haven't been following the thread :-D)

Yes, It should return just the value.

Can you check the curl & grep versions of older macOS? Then we can check the changelog for these tools

I figured a way out to get rid of the unwanted infos.

I red something of the "grep" functions and hid unwanted things with "grep -v"

I don't know if this is a "clean" way to do this, but it seems to work for now.

I saved a Version where I changed nothing but the grep -v thing so that you can /test/use/upload it at some time if you want to.

K2 CoronaVirus Monterey.bttpreset (618.2 KB)

Maybe this works with Big Sur AND Monterey ... if yes, this could save you some work in the future.

Edit: This is what "Today Cases" looks now, just as an example ...

do shell script "curl https://covid19-cli.wareneutron.com/basic/" & Country & " -si | grep -m1 -A1 'Today Cases' | grep -v 'Active' | sed 's/.*Today Cases *| //g'"

1 Like

Thanks for doing that leg work. That should work for new and old. Ill check that out later as well.

2 Likes

Total noob here, really keen to see this in action on my touchbar, but I just can't get it to work at all, even after following all of the instructions on this thread and trying to copy other people's scripts. Is there a quick tutorial I'm able to find somewhere or just script I can copy and substitute my own country (Australia) into?

Thanks!