SmartBlocks icon indicating copy to clipboard operation
SmartBlocks copied to clipboard

Weather Forecast 2.2

Open eatondpe opened this issue 3 years ago • 20 comments

✂️ Copy of your #42SmartBlock from Roam

Download this file and import the enclosed JSON into your Roam Graph. Weather Forecast v2.2.zip

📋 Describe the SmartBlock

This is an enhanced version of the Weather Cards SmartBlock. Version 2.0 shows the weather for the next 3 days, along with any weather alerts or special weather statements active at the time. You now also update the forecast at the click of a button, or change to another location by clicking the Change button. This version is also faster and more reliable than the earlier version.

Changes in this version:

  • Added setting weatherDirectToDefault. Setting this to 'yes' will use the value in the weatherDefaultLocation setting and bypass the prompt on the first run. The prompt will appear when pressing the Change button regardless of this setting.
  • Added setting weatherUnits. Set this to imperial or metric as desired.
  • Added day of week to weather cards.

✅ Describe any prerequisites or dependencies that are required for this SmartBlock

These prerequisites are also listed in the SmartBlock.

  1. You will need an API Key from https://openweathermap.org/api for this to work.
  2. You will need to copy the CSS blocks found in the SmartBlock to your roam/css page.

📷 Screenshot of your #42SmartBlock workflow/template from Roam

image

💡 Additional Info

See it in action. (The delays you will see are from me entering location information in an off-screen pop-up.) https://www.loom.com/share/30cdac47b11b4f9ab348d76b4b607a0d

eatondpe avatar Mar 09 '21 13:03 eatondpe

HI David, thank you for the great smartblock! I am having some trouble with the short code setting, the block will not fire when I enter wvg into the prompt it works when I use westlake village, ca, us please see attached and let me know if you can suggest a solution.

Also, is there a way to set the default location and avoid the prompt altogether?

Thanks again!

image

jeffrappaport avatar Mar 09 '21 18:03 jeffrappaport

HI David, thank you for the great smartblock! I am having some trouble with the short code setting, the block will not fire when I enter wvg into the prompt it works when I use westlake village, ca, us please see attached and let me know if you can suggest a solution.

Also, is there a way to set the default location and avoid the prompt altogether?

Thanks again!

image

Hi, @jeffrappaport. Try removing the spaces after the commas. So, westlake villiage,ca,us should work. Let me know if it still doesn't. I will also put in some code to account for this in the future.

I can add an option to skip the prompt. I assume only on first run, not on Change. Sound good?

I can have both of these changes up within the hour, I should think.

eatondpe avatar Mar 09 '21 19:03 eatondpe

@jeffrappaport Correction. The issue with wvg is that it must end with a semi-colon: wvg: westlake village, ca, us;

The semi-colon, followed by a line-break, is what I use to delimit one favorite from another.

eatondpe avatar Mar 09 '21 19:03 eatondpe

thanks David. I removed the line" Enter your favorite locations on separate lines below as aalias, and it worked!

jeffrappaport avatar Mar 09 '21 21:03 jeffrappaport

Hi David, Nice update to your original block. Only issues I see is the name of the day2 shows as tomorrow. It would be good to retrieve the day name from dayjs if possible. Second one is this is only showing US units. Is there a way to show international units? Cheers, Mark

mlava avatar Mar 09 '21 21:03 mlava

@mlava I should be able to do that.

eatondpe avatar Mar 09 '21 21:03 eatondpe

@mlava I think this version (2.2) does what you need. I added a setting to choose between imperial and metric measures. I replaced Today, Tomorrow, and the other Tomorrow with day of week, month, year: e.g., Tuesday, Mar 9, 2021.

image

eatondpe avatar Mar 09 '21 22:03 eatondpe

Wow, that was fast. Am away from computer but will download later today. Cheers!

On Wed, 10 Mar 2021, 9:30 am eatondpe, [email protected] wrote:

@mlava https://github.com/mlava I think this version (2.2) does what you need. I added a setting to choose between imperial and metric measures. I replaced Today, Tomorrow, and the other Tomorrow with day of week, month, year: e.g., Tuesday, Mar 9, 2021.

[image: image] https://user-images.githubusercontent.com/67427527/110546805-fb3b1800-80fc-11eb-8920-e684036d8329.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/roamhacker/SmartBlocks/issues/211#issuecomment-794542653, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUKIPT725VZCA3YLLGZNHTTC2HONANCNFSM4Y3R5P7Q .

mlava avatar Mar 09 '21 22:03 mlava

Hi David, unable to upload 2.2 I tried deleting prior blocks, but no luck

image

jeffrappaport avatar Mar 09 '21 23:03 jeffrappaport

@jeffrappaport Did you delete the page that was created when you did the earlier import?

eatondpe avatar Mar 09 '21 23:03 eatondpe

@eatondpe yes

jeffrappaport avatar Mar 09 '21 23:03 jeffrappaport

@jeffrappaport OK. Do you have or can you create another graph you can import this into? And then copy everything on the page and paste it into the graph where you want to use it?

eatondpe avatar Mar 09 '21 23:03 eatondpe

@eatondpe worked! thank you

jeffrappaport avatar Mar 09 '21 23:03 jeffrappaport

I'd love to use this, but https://openweathermaps.org/api has been down for a few days now. I wonder if there's an alternative.

kmaustral avatar Mar 12 '21 03:03 kmaustral

@kmaustral @eatondpe there is a typo in the readme file The site is https://openweathermap.org/api not openweathermaps.org/api (no 's')

jeffrappaport avatar Mar 12 '21 16:03 jeffrappaport

Thanks, @jeffrappaport. This has now been corrected.

eatondpe avatar Mar 12 '21 17:03 eatondpe

@eatondpe thank you for the wonderful SmartBlock! I have it at the very top of my DNP SmartBlock

jeffrappaport avatar Mar 12 '21 17:03 jeffrappaport

I have this issue where if I call the Weather SmartBlock from another SmartBlock, the execution of the SmartBlock stops when the Weather SmartBlock is returned. Anyone know how to address this?

faurehu avatar Mar 14 '21 03:03 faurehu

I encountered the same issue. Resolved it by turning the weathersmartblock into a button https://roamresearch.com/#/app/roamhacker/page/-y5HVWAXw

jeffrappaport avatar Mar 14 '21 16:03 jeffrappaport

Is this still functional? I am not able to get this to work even after trying all the suggestions above. But I also don't see any posts since March. So, not sure if the problem is on my end or what.

Elwood4415 avatar Sep 22 '21 03:09 Elwood4415