Grab a 10-day forecast chart screenshot from wunderground.com for any city, caption it with the location and timestamp, save it locally, and optionally upload it anonymously to imgur.
| Full chart (Los Angeles) | --short --dark (Seattle) |
|---|---|
![]() |
![]() |
- Looks up any city (and optional state) via a public geocoding endpoint - no API key setup needed
- Screenshots just the forecast chart itself (headless Firefox via Playwright), not the whole page
- Captions the image with the resolved location and timestamp
--dark- dark mode via the real DarkReader engine--short- just the temperature and humidity/pressure/cloud panels, skipping precip accumulation and wind speed--upload- anonymous imgur upload, prints the link and a delete link- Saves a
.txtinfo file alongside each image with the resolved address, source URL, and (if uploaded) imgur link/delete hash
- Python 3.9+
- Playwright with the Firefox browser
pip install playwright requests Pillow
playwright install firefox./wu-forecast.py Seattle WA
./wu-forecast.py "New York" NY --upload
./wu-forecast.py Seattle WA --dark --short --view
./wu-forecast.py "Los Angeles" CA -o ~/weather --upload -qOn Windows, run it as python wu-forecast.py Seattle WA instead.
| Flag | Description |
|---|---|
city |
City name (and optional state), e.g. Seattle WA |
-o, --output-dir |
Directory to save the PNG + info file (default: ~/weather-forecasts) |
-u, --upload |
Upload the image anonymously to imgur |
--imgur-client-id |
Imgur Client ID (or set IMGUR_CLIENT_ID); defaults to a public anonymous-upload client ID |
--dark |
Dark mode via DarkReader |
--short |
Only the temperature and humidity/pressure/cloud panels |
--padding |
Horizontal padding in pixels (default 5, 0 to disable) |
--no-caption |
Don't overlay the location/timestamp caption on the image |
--latest |
Also point a stable filename (default latest.png) at this run's image - symlink on Linux/macOS, copy on Windows |
--latest-name |
Filename to use for --latest (default: latest.png) |
--wait |
Seconds to wait for the page/chart to render (default 2.5) |
--no-headless |
Run Firefox with a visible window (useful for debugging) |
--view |
Open the saved image after saving |
-q, --quiet |
Only print the final result line |
- Anonymous imgur uploads only need a Client ID, not a secret API key - register your own for free at api.imgur.com if you'd rather not use the built-in public one.
- Each run writes both
{city}_{timestamp}.pngand{city}_{timestamp}.txtto the output directory. - Use
--latest(e.g. in a cron job) to keep a stablelatest.pngpointing at the newest screenshot - handy for pointing a desktop widget (KDE Media Frame, etc.) at a fixed path instead of a timestamped one. It's a symlink on Linux/macOS and a plain copy on Windows, since Windows symlinks usually need elevated permissions.

