Tutorial: Build a Morning Notification Tool
In this tutorial, youâll build a tool that sends you daily notifications at 8am with your schedule and weather forecast. Youâll learn how to integrate with Google Calendar and Slack/Email.
Final Result
Every morning at 8am, youâll receive a Slack (or email) notification like this:
Good morning! Here's your schedule and weather for today.
ăToday's Scheduleă
- 10:00-11:00 Team Meeting
- 14:00-15:00 Client Meeting
- 16:00-17:00 1-on-1
ăWeatheră
đ Home (Shibuya): Sunny, High 18°C / Low 8°C
đ˘ Office (Minato): Sunny, High 17°C / Low 7°C
âď¸ No umbrella needed today
Have a great day!Time Required
1-2 hours
Prerequisites
- Environment setup is complete
- Google account (for Calendar integration)
- Slack workspace access (if using Slack notifications)
Step 1: Create Project Folder
Open Folder in VS Code
- Launch VS Code
- From the menu, select âFileâ â âOpen Folderâ
- Create and open a new folder called
~/projects/morning-notify
Open Claude Code
Click the Claude icon in VS Codeâs left sidebar to open the chat panel.
Step 2: Create Weather Fetching Feature
Letâs start simple by building the weather information retrieval.
Tell Claude
Create a Python script that fetches weather forecasts.
Features:
- Use OpenWeatherMap API (has free tier)
- Get weather for 2 locations
- Location 1: Shibuya, Tokyo (home)
- Location 2: Minato, Tokyo (office)
- Get today's weather, high/low temperature, precipitation chance
- Determine if an umbrella is needed
Output example:
đ Home (Shibuya): Sunny, High 18°C/Low 8°C, 10% chance of rain
đ˘ Office (Minato): Sunny, High 17°C/Low 7°C, 15% chance of rain
âď¸ No umbrella needed
Name the file weather.py.
Load API key from environment variables.Get OpenWeatherMap API Key
- Visit OpenWeatherMapÂ
- Create a free account
- Get your key from the API Keys page
Set Environment Variables
Create a .env file to store the API key.
Also create .gitignore so .env won't be published.Step 3: Google Calendar Integration
Next, add the feature to get todayâs schedule.
Tell Claude
Create a script to get today's events from Google Calendar.
Features:
- Use Google Calendar API
- Get today's events in chronological order
- Display event title, start time, and end time
Name the file calendar.py.
Read credentials from credentials.json and save token to token.json.Google Calendar API Setup
- Go to Google Cloud ConsoleÂ
- Create a new project
- Go to âAPIs & Servicesâ â âLibraryâ and enable âGoogle Calendar APIâ
- Go to âCredentialsâ â âCreate Credentialsâ â âOAuth Client IDâ
- Select âDesktop Appâ
- Download
credentials.jsonand place it in your project folder
Test Run
Run calendar.py and get today's scheduleA browser authentication window will open on first run.
Step 4: Create Notification Feature (Slack)
Add the feature to send notifications to Slack.
Tell Claude
Create a script to send notifications to Slack.
Features:
- Use Slack Incoming Webhook
- Post messages to a Slack channel
Name the file notify_slack.py.
Load Webhook URL from environment variables.Slack Webhook Setup
- Go to Slack APIÂ
- Click âCreate New Appâ â âFrom scratchâ
- Enter app name and select workspace
- Enable âIncoming Webhooksâ
- Click âAdd New Webhook to Workspaceâ and select the channel
- Copy the Webhook URL and add it to
.env
Step 5: Integrate Everything
Combine weather, calendar, and Slack notification into one script.
Tell Claude
Integrate weather.py, calendar.py, and notify_slack.py
into a single morning notification script.
Name the file morning_notify.py.
Flow:
1. Fetch weather information
2. Get today's schedule
3. Compose the message
4. Send to Slack
Message format:
---
Good morning! Here's your schedule and weather for today.
ăToday's Scheduleă
- [time] [event name]
...
ăWeatheră
đ Home (Shibuya): [weather] High °C/Low °C
đ˘ Office (Minato): [weather] High °C/Low °C
âď¸ [umbrella advice]
Have a great day!
---Step 6: Set Up Scheduled Execution
Configure automatic execution every morning at 8am.
For Mac (launchd)
Create a launchd configuration file to run morning_notify.py every morning at 8amFor GitHub Actions (Cloud Execution)
Create a GitHub Actions workflow to run morning_notify.py every day at 8am (local time).
Also explain how to set the required environment variables in Secrets.If You Want Email Notifications Instead
You can also send notifications via email instead of Slack.
Tell Claude
Change from Slack notification to sending email via Gmail.
Send to my own email address.
Use Gmail API.Troubleshooting
Google Calendar Authentication Error
Delete token.json and re-run calendar.pyRe-authentication in the browser will be required.
Canât Get Weather
Check if the API key is set correctly:
Check the contents of .env and verify OPENWEATHER_API_KEY is setCanât Post to Slack
Verify the Webhook URL is correct.
Try sending a test message.Advanced Challenges (If Time Permits)
Clothing Advice Based on Weather
Add clothing advice based on temperature.
Example: Below 10°C suggest "Don't forget your coat"Train Delay Information
Add delay information for commuter train linesMultiple Calendar Integration
Integrate and display both work and personal calendarsChecklist
- Opened Claude Codeâs chat panel in VS Code
- Successfully fetched weather information
- Retrieved schedule from Google Calendar
- Sent notification to Slack (or email)
- Created the integrated script
- (Optional) Set up scheduled execution
Next Steps
- Excel Data Tool - Try business data analysis
- Sample Templates - Explore other ideas
Use the API integration knowledge from this tutorial to build your own tools!