I live in sun kissed San Jose, California. Where weather is great, most of the time. I just like to sit in the sandy beach, watch the waves crashing on the beach. I would like to visit beach as often as I could.
Most of the time though I forget to check the weather in weekday and forget to plan for beach (It’s not fun to go out on beach on windy cloudy day). So even though I live near beach, most weekends I end up doing something else.
Calendar
Ever since I started using smart phone, my attention span has gone way low. You have access to so many things at your fingertips. There is no way you can go through all the apps, news and notifications at once when you are just checking out your phone at Starbucks or in commute for few minutes.
So if I need to take care of something or work on some item, I have to put it in my calendar. This way I can plan my day and focus on most important things.(Because you know what happens once you open the door to twitter)
So I was wondering, is there a service or something else that can notify my when weather is going to be good at the beach in weekends in advance, so I can make weekend plans accordingly?
To my surprise, I didn’t find readily available solution. There was an IFTTT receipe for weather notification, but it would notify me if today’s weather matches my desired criteria, which would be too late for me.
Google App script to the rescue!
Turns out Google App script was perfect for my use case. Script would fetch weather for my nearest beach during middle of weekday. If weather matches my criteria, it would create a calendar event and notify my in advance so I can make my plans accordingly, neat!
Creating Script
One of the biggest reason for choosing Google App script was easy of integration with google service. Without much boilerplate, you can create a calendar event or send an email with just a call to an API.
There are multiple ways you can get weather from an API. I chose Yahoo weather API. In weather API, you need to provide location. From the result, you can create your own logic of your preferred weather for the beach.
If the weather is perfect for the beach, you can use Google App script’s API for Calendar to create an event and notify you in advance.
Here is the link to my implementation
https://script.google.com/d/1ylWb29X1XHJyEWj64Vq18Q7ywiNUUke7mmRE6ciRmc_YUn5pEgRKZYh1
Conclusion
If you really want to check out the beach more often or do hiking, cycling, fishing or any other activity, don’t let your laziness or busy work week stop you from doing that.
I can organize my day better and waste less time if I have an entry of what I need to do on my calendar. Find out what works best for you to achieve your goals.