Jump to content

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


Recommended Posts

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
Link to comment

@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

Link to comment
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).

Link to comment
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? :)

Link to comment

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)

 

Link to comment
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
Link to comment
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
Link to comment
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?

Link to comment
  • 1 month later...
On 3/16/2020 at 11:26 AM, eheupel said:

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)

 


I am facing the same issue:

ERROR: Corona Time[Script Filter] Code 1: /Users/avinash/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/C653FCCB-C1AC-4350-AE4F-6E10B1D7A37E:31:in `<main>': undefined method `prepend' for #<Array:0x00007f8b0e0e0c68> (NoMethodError)

Can someone help with this?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...