#!/usr/bin/python3 import smtplib import sys import time import requests from datetime import date from bs4 import BeautifulSoup from email.mime.text import MIMEText from email.utils import formatdate import on_this_day import email_helper from config import config def get_weather(): print("getting weather") weather_url = "https://forecast.weather.gov/MapClick.php?lon=%s&lat=%s" % (config["weather"]["lon"], config["weather"]["lat"]) soup = BeautifulSoup(requests.get(weather_url).text, features="lxml") return str(soup.select("#detailed-forecast")[0]) def get_unread_reminders(): print("getting unread reminders") subjects = email_helper.filter_unread("subject", "REMINDER:", "subject") subjects = [s[len("REMINDER: "):].strip() for s in subjects] if len(subjects) > 0: reminder_html = "