This is the code behind the simple single serving site, istheltrainfucked.com. It relies on the MTA’s API and is by no means optimized. It also does not provide real-time information, as the MTA has not made that data available. I wrote a little blog post about it here. Feel free to fork it and add your own train.