Skip to content

Daily SMS weather alert, scheduled using AWS Lambda

Notifications You must be signed in to change notification settings

naomistuart/weather-msg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☀️ weather-msg

The goal of this project is to build an AWS Lambda function which sends a SMS message every morning to a user's phone, summarising today's weather forecast.

Features

  • AWS Lambda function automatically triggered every morning at 7:30 am to send a short SMS message
  • SMS message summarises the latest weather forecast for Sydney, including maximum temperature, chance of rain, and time period when sun protection is recommended.

Built with

  • BeautifulSoup - Python library used to scrap the Bureau of Meteorology's web page for Sydney weather
  • Twilio - API used to send SMS messages
  • AWS Lambda - Used to automatically execute Python code every morning.

Method

A brief description of the steps in this project:

1. Web scraping

  • Use Python's Requests library to grab HTML content from the Sydney Forecast webpage
  • Use BeautifulSoup to parse the HTML content and pull out relevant information, including today's weather description, maximum temperature, chance of rain, and sun protection recommendations.

2. Use Twilio to send SMS

  • Format the scraped data into a tidy text string, to be used in the body of the SMS message
  • Send the SMS message using Twilio's Python helper library.

3. Build AWS Lambda function

  • Combine the code from steps 1-2 into a function
  • Create a zip archive of library dependencies, together with the function code
  • Upload the deployment package to AWS Lambda
  • Schedule the AWS Lambda function to run every morning, by using a cron expression in a CloudWatch trigger.

References

About

Daily SMS weather alert, scheduled using AWS Lambda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published