Skip to content
The Lazy Administrator
  • Home
  • Disclaimer
  • Contact
  • About Me
  • Search Icon

The Lazy Administrator

Finding ways to do the most work with the least effort possible

How I Automated the Tracking of the Holiday Metra Train

How I Automated the Tracking of the Holiday Metra Train

December 17, 2025 Brad Wyatt Comments 0 Comment

Table of Contents

  • Objective
  • How I Setup The Automation
    • Pushover
    • Transit Stat API
    • Azure
      • Storage Account
      • Automation Account
  • Review
source: https://www.facebook.com/MetraRail/posts/all-aboard-the-holiday-train-tickets-for-our-holiday-train-go-on-sale-monday-nov/865445549331428/

Objective

This post is a bit different from my usual content, as it may only be of interest to people living in the Chicagoland area. Chicago’s regional commuter rail is called the Metra, and during the holidays they have several trains that are decked out in holiday lights and the inside is decorated with lights, ornaments, and other holiday decor.

Note: This is not to be confused with the Metra holiday train where you ride it and meet Santa, while they may use the same trains, Metra will also use the holiday trains for regularly scheduled trains in and out of the city.

As a father with a kid who loves everything about trains, I looked to see if Metra published a schedule or if there was a way I could track the holiday trains so we could get on it. The only thing I found was the following website that showed where trains were at any given moment, and would show the holiday train as a candy cane circle. The only issue was that I had to constantly go to the website to see when and where the trains would pop up, it wouldn’t know where they were until they were put into service. This gave me the idea on having something automated check to see where the holiday trains were and only if it met certain criteria, alert me via a push notification.

If you don’t care how this all works and just want to subscribe to your train line, you can use the table below to subscribe to a specific train line. Once you download the Pushover app and sign in, you will get notifications whenever a holiday train enters that line.

Train LineSubscribe URL
UPWhttps://pushover.net/subscribe/UPW-TrainTracker-dctztqpxwq7d3pc
BNSFhttps://pushover.net/subscribe/BNSF-TrainTracker-f9skoo4nbe579fb
UPNWhttps://pushover.net/subscribe/UP-NW-TrainTracker-126dpagwjkp88hm
UPNhttps://pushover.net/subscribe/UPN-TrainTracker-hydoyxaqataxtkn
SWShttps://pushover.net/subscribe/SWS-TrainTracker-14grv6kxmakbpk1
RIhttps://pushover.net/subscribe/RI-TrainTracker-yxxniw8sh7j7aqp
NCShttps://pushover.net/subscribe/NSC-TrainTracker-igp6ykx2whnvx4o
MDWhttps://pushover.net/subscribe/MDW-TrainTracker-nt199iktq6sbjkh
MDNhttps://pushover.net/subscribe/MDN-TrainTracker-gt8fddmch887b7t
MEhttps://pushover.net/subscribe/ME-TrainTracker-ec9oeg6m7n67ws1
HChttps://pushover.net/subscribe/HC-TrainTracker-673imporq8kc46v

How I Setup The Automation

The automation uses the following:

  1. Pushover for mobile notifications
  2. transitstat.us REST API
  3. Azure Storage Table (log trains we have notified and do not notify again unless its been >1 hr
  4. Azure Runbook (runs the automation script on a schedule)

Pushover

Pushover is a service and app (Android, iOS, Desktop) that you can use to push notification’s to different endpoints. I set up a group for each train line so when a holiday train appears on that line, it will send a notification to the users of that group. I also set up subscriptions so people can subscribe to 1 or more line. All you need to do is create your free pushover account, subscribe to 1 or more lines, and install the app. Whenever a holiday train enters a line you subscribe for, it will send you a push notification.

Transit Stat API

The Transit Stat API contains all of the trains, train lines, their current positions, eta, etc. The API also includes a property so we know which train is a holiday train.

Azure

Storage Account

Since I am using an Azure Runbook to run my automation, I decided to also use an Azure Storage Table to log the trains we alert on so we don’t keep alerting on the same trains over and over again. I put a 1hr block in there so if the same train is found on the next run, it will not alert until the time from the previous alert is over 1hr. Some trains run over 1hr so it is possible that it can alert more than once for that train. During rush hour its common to have express trains run to the suburbs in well under an hour and then get put into service going back into the city. In those cases I wanted to ensure that we could alert on the train as it comes back into the city. Metra may or may not use the same train number, I didn’t care to dig into how they number their trains.

Automation Account

I am having my script ran via an Azure Automation Account. This ensures it will run even if my computer is off (since its using cloud compute). I have a schedule set so it runs every 10min.

Review

Hopefully Metra will add a way in the future to easily track the holiday trains because I can’t imagine I am the only one trying to ride it.

Brad Wyatt
Brad Wyatt

My name is Bradley Wyatt; I am a 5x Microsoft Most Valuable Professional (MVP) in Microsoft Azure and Microsoft 365. I have given talks at many different conferences, user groups, and companies throughout the United States, ranging from PowerShell to DevOps Security best practices, and I am the 2022 North American Outstanding Contribution to the Microsoft Community winner.


API, PowerShell
Automation, Azure, PowerShell

Post navigation

PREVIOUS
Using PowerShell to Block GitLab Merges with Unchecked Issue Checkboxes

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe

Email


Categories

  • Active Directory (8)
  • AI (3)
  • API (2)
  • AutoPilot (2)
  • Azure (18)
  • Bicep (4)
  • Connectwise (1)
  • Defender for Cloud Apps (1)
  • Delegated Admin (1)
  • DevOps (9)
  • Graph (7)
  • Intune (16)
  • LabTech (1)
  • Microsoft Teams (6)
  • Office 365 (19)
  • Permissions (2)
  • PowerShell (53)
  • Security (1)
  • SharePoint (3)
  • Skype for Business (1)
  • Terraform (1)
  • Uncategorized (2)
  • Yammer (1)

Recent Comments

  • Baru01 APK on Windows LAPS Management, Configuration and Troubleshooting Using Microsoft Intune
  • Jason on Auto Deploy Progressive Web Applications (PWA) using Intune or PowerShell
  • hiwin on The Microsoft Graph Command-Line Interface (CLI)
  • fabio on Set-ADUser: Dealing with Null Values when Importing a CSV; Working with Parameters and Properties that don’t Accept Empty Strings
  • Dominik on Auto Deploy Progressive Web Applications (PWA) using Intune or PowerShell

1,832,945 People Reached

© 2025   All Rights Reserved.