dvargas92495 / SmartBlocks

Useful examples from developer community for Roam42 SmartBlocks
147 stars 7 forks source link

Weather Forecast 2.2 #211

Open eatondpe opened 3 years ago

eatondpe commented 3 years ago

✂️ 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:

✅ 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

jeffrappaport commented 3 years ago

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

eatondpe commented 3 years ago

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 commented 3 years ago

@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.

jeffrappaport commented 3 years ago

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

mlava commented 3 years ago

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

eatondpe commented 3 years ago

@mlava I should be able to do that.

eatondpe commented 3 years ago

@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

mlava commented 3 years ago

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

On Wed, 10 Mar 2021, 9:30 am eatondpe, notifications@github.com 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 .

jeffrappaport commented 3 years ago

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

image

eatondpe commented 3 years ago

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

jeffrappaport commented 3 years ago

@eatondpe yes

eatondpe commented 3 years ago

@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?

jeffrappaport commented 3 years ago

@eatondpe worked! thank you

kmaustral commented 3 years ago

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.

jeffrappaport commented 3 years ago

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

eatondpe commented 3 years ago

Thanks, @jeffrappaport. This has now been corrected.

jeffrappaport commented 3 years ago

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

faurehu commented 3 years ago

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?

jeffrappaport commented 3 years ago

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

Elwood4415 commented 2 years ago

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.