Shark.Formax Posted March 13, 2020 Share Posted March 13, 2020 (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. Edited March 14, 2020 by atheos add gif from version 1.1.0 Link to comment
deanishe Posted March 14, 2020 Share Posted March 14, 2020 9 hours ago, atheos said: for your state/province So this is US/Canada only? Link to comment
edbro Posted March 14, 2020 Share Posted March 14, 2020 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 }] Link to comment
Shark.Formax Posted March 14, 2020 Author Share Posted March 14, 2020 @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. Link to comment
deanishe Posted March 14, 2020 Share Posted March 14, 2020 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
Alfraid Posted March 15, 2020 Share Posted March 15, 2020 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? :) JJJJ 1 Link to comment
deanishe Posted March 15, 2020 Share Posted March 15, 2020 1 hour ago, Schneppi said: Replace "state" with "Country_Region" and you can search for other Countrys Thanks. I did figure that out, but it's not as interesting as city/state (to me at least). For anyone else interested in German data, the Berliner Morgenpost has a realtime map. Link to comment
eheupel Posted March 16, 2020 Share Posted March 16, 2020 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
Alfraid Posted March 16, 2020 Share Posted March 16, 2020 (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 March 16, 2020 by Schneppi Fork deleted Link to comment
Shark.Formax Posted March 16, 2020 Author Share Posted March 16, 2020 @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. Alfraid 1 Link to comment
deanishe Posted March 17, 2020 Share Posted March 17, 2020 (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 March 17, 2020 by deanishe Shark.Formax 1 Link to comment
Nick Ang Posted March 18, 2020 Share Posted March 18, 2020 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. 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
Shark.Formax Posted March 19, 2020 Author Share Posted March 19, 2020 (edited) @Nick Ang I use Gifox 2 - it's a built in feature https://gifox.io/ However if you just want the key display try KeyCastr https://github.com/keycastr/keycastr I think Gifox used the code from keycastr considering how similar the key display looks. Edited March 19, 2020 by atheos add keycastr Link to comment
Avinash Posted April 28, 2020 Share Posted April 28, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now