Jump to content
atheos

Corona Time - Workflow for tracking local cases of COVID-19 / Coronavirus

Recommended Posts

Posted (edited)
View on github: https://github.com/dkarter/CoronaTime

## Corona Time: An Alfred Workflow For Tracking COVID-19

See case statistics for your state/province: ☣️ Confirmed,  Recovered, and ☠️ Deaths.

Data is provided by ArcGIS Esri Corona Virus Dataset.

## DEMO

See attached

## Installation

1. Download and open the [workflow file from this repo](https://github.com/dkarter/CoronaTime)
2. Enter your State/Province:

See Attached (or github)

3. If you like it, please star (on github) and share for reach!

## License

MIT

Dataset is provided by ArcGIS Esri Corona Virus dataset and subject to ArcGIS Esri terms of licensing.

screenshot.png

settings.png

Edited by atheos
add gif from version 1.1.0

Share this post


Link to post

Thank you for this. It was confusing at first until I realized I also had to change the title text to say Texas instead of Illinois.

 

items = [{ title: 'Cases in Texas:', valid: false }]

Share this post


Link to post

@deanishe I don't know all countries that the API supports, but I was able to confirm US, Canada, Australia and China (I tried Essen / Düsseldorf but couldn't find it, sorry mate).

@edbro That was a bug! Thanks for letting me know. I've released a new version to address this (v1.1.0) which also allows you to search for other states / provinces other than the one you configured.

 

demo.gif

Share this post


Link to post
9 minutes ago, atheos said:

I don't know all countries that the API supports, but I was able to confirm US, Canada, Australia and China (I tried Essen / Düsseldorf but couldn't find it, sorry mate).

 

Thanks. I found the dataset, and it only supports China, US, Canada and Australia at below national level. And as you're specifying "Province_State" in the query, it won't find "Germany" etc. (which isn't very interesting, anyway, vs local data).

Share this post


Link to post
On 3/14/2020 at 9:52 AM, deanishe said:

So this is US/Canada only?

 

Replace "state" with "Country_Region" and you can search for other Countrys

 

uri = URI("https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/1/query?f=json&where=Country_Region%3D'#{encoded_state}'&outFields=Confirmed,Recovered,Deaths")

Maybe @atheos can add a fallback search for Country/Region if a search for the state failed? :)

Share this post


Link to post

Love the idea of this workflow and the demo shown here. Unfortunately I'm running into an issue with running it. On Mojave (10.14.6) with ruby 2.3.7p456 and Alfred 4.0.8. Changed the variable to 'Texas'. When I put in the keyword (';co') the icon comes up says "Fetching....please wait." then very shortly changes to "Search Google for ';co'; Search amazon for ';co' etc...

Checking in the debugger its throwing an undefined method error for prepend. Unfortunately I'm a total noob with Alfred workflows and total noob with Ruby. Any ideas for resolving? Or link to a thread to sort a more generic issue I may have with the Alfred install and more fun workflows?

 

01:51:42.895] Corona Time[Script Filter] Queuing argument '(null)'
[01:51:43.181] Corona Time[Script Filter] Script with argv '(null)' finished
[01:51:43.205] ERROR: Corona Time[Script Filter] Code 1: /Users/fubar/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/1BCD74C6-A858-40C0-BC9A-AED05BC25880:30:in `<main>': undefined method `prepend' for #<Array:0x00007f8fb582db00> (NoMethodError)

 

Share this post


Link to post
Posted (edited)
23 hours ago, deanishe said:

Thanks. I did figure that out, but it's not as interesting as city/state (to me at least).

 

I forked it and added the fallback search, making it effectively usable for the rest of the world. ;)

Hope you add my pull into your master.

 

[FORK DELETED:BC it's been implemented by atheos in his 1.2.0 release] https://github.com/Schneppi/CoronaTime

Edited by Schneppi
Fork deleted

Share this post


Link to post

@Schneppi Thank you! I actually added this feature yesterday but didn't have time to publish it until now. It is now out in 1.2.0.

 

I wish Alfred workflows were easier to collaborate on for developers... I've added the source code in a separate file so that I can take PRs in the future, if you have further improvements please open a PR.

Share this post


Link to post
Posted (edited)
16 hours ago, atheos said:

I wish Alfred workflows were easier to collaborate on for developers...

 

It's the way you've set up your workflow and repo. Don't put your Ruby code in the Script box. It's a poor editor and having all your code in info.plist isn't very compatible with git. Use an external script in the workflow directory instead, and put the contents of the workflow in your repo, not just the zipped .alfredworkflow file.

 

That way, people can clone the repo and symlink the src subdirectory to Alfred's workflow directory, making it pretty easy to make PRs.

Edited by deanishe

Share this post


Link to post
On 3/14/2020 at 11:44 PM, atheos said:

@deanishe I don't know all countries that the API supports, but I was able to confirm US, Canada, Australia and China (I tried Essen / Düsseldorf but couldn't find it, sorry mate).

@edbro That was a bug! Thanks for letting me know. I've released a new version to address this (v1.1.0) which also allows you to search for other states / provinces other than the one you configured.

 

demo.gif

 

Side tracking a little, what's the tool you're using to show the typed keystrokes on your screen when recording this gif?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...