7 ms·
Show HN: When is the next Caltrain? (minimal webapp)
I was frustrated with the existing caltrain websites / apps, so I made a super minimalist one to answer the actual question I have: how long until the next train?
If you're in SF it grabs the next southbound trains, otherwise, the next northbound.
- deleted 1y ago[deleted]
- PaulHoule 1y agoI am not in the area so I had to click on the thing to view all schedules, I would say it is super slick, I like it.
- bkettle 1y agoFor me the “all schedules” link is just the schedule on the official Caltrain website (which I actually quite like)
- lindig 1y agoThe public transport service in Hannover/Germany once had a screensaver that you could configure to show the next departure from your nearest station. I thought that was clever marketing. Today you probably could implement this as a web service.
- FredPret 1y agoScreensavers can / could ping an API? That train schedule seems like a cool idea in and of itself though.
- simoncion 1y agoIn the Windows 95 days (and probably in the Windows 2000 days, and maybe also today) "all" a screensaver was was an .exe renamed to -if memory serves- .scr. There may have been some special interface that the program being run was expected to conform to so the screensaver subsystem would invoke it, but (IIRC) a screensaver could do anything an ordinary program could do. (That was the big reason for being cautious about where/who you got your screensavers from.)
- npinsker 1y agoThanks, this'll be a nice little timesaver!
- eschluntz 1y agoThanks :)
- nilsbunger 1y agoVery cool. Would be good if it also shows whether it's a local train or limited or express, and/or which stations it stops at.
- eschluntz 1y agobullet trains should be displayed in red, but I haven't tested it yet at the right time and I've been too lazy to write tests with mocked time / gps :)
- sentientslug 1y agoLooking at it now and the bullet has black text
- andreyk 1y agohaha nice, the official caltrain schedule is a bit of a hassle to parse...
- aeternum 1y agoClosest station: San Francisco But there are two SF stations
- eschluntz 1y ago"22nd st" shows up separately
- mslate 1y agoWhile cool, this does not incorporate real-time data, just the static schedule. I've explored this--you need 511 API access to obtain real-time data, and to conceal your API key you need to stand up a web application. Cool proof-of-concept, need to take it to the next level!
- eschluntz 1y agoI thought about this, but I've seen several times where the signs say that the train is running late, but it's actually there and leaves perfectly on time! The schedule has been much more reliable since the electrification
- aaronbrethorst 1y agoFor anyone interested in getting the aforementioned access, you can find the 511 request URL here: https://www.transit.land/feeds/f-sf~bay~area~rg~rt https://www.transit.land/feeds/f-sf~bay~area~rg~rt GTFS-RT data isn't a lot of fun to work with directly, though, so I'd recommend that you use an intermediary like OneBusAway (OBA) to interpret the data and give you a nicer to use API. You can find more about OBA here: https://onebusaway.org https://onebusaway.org and our GitHub organization is here: https://github.com/onebusaway https://github.com/onebusaway Our docker images repo has pretty good docs about running a server: https://github.com/OneBusAway/docker https://github.com/OneBusAway/docker And the SDKs can all be found here: https://developer.onebusaway.org/api/sdk https://developer.onebusaway.org/api/sdk (n.b. I've been a volunteer on the project for years and am currently serving as the part time exec director of the nonprofit behind OBA.)
- nektro 1y agoapp hard dies if it's unable to get your location. was really expecting the "full schedule" link to show an input box to pick a station
- eschluntz 1y agoHow else m I going to geotarget you with ads? /s
- thot_experiment 1y agoI have a command line app for this somewhere I wrote a few years back when I was commuting on Caltrain a lot, I should dig it up and publish it. It had some extra pathfinding/fuzzy search stuff. I almost always have my bike with me and I wanted to cover the edge cases where it's faster to bike to a nearby station to catch a bullet or where you can take a train the wrong direction a stop or two for the same purpose. I wish there a maps app that would build entire itineraries taking into account that you have a bike with you, and ideally your average expected biking speed. It's so annoying to plan any sort of multi-transit itinerary in the bay, you always have to piece things together yourself or get stuck with some nonsense that takes 30% longer than it needs to. Of course all of this could also be resolved if we had a sane transit system with short intervals.
- xd1936 1y agoDoes Transit[1] not do this? It suggests routes including walking and biking when I input my destination... 1. https://transitapp.com/ https://transitapp.com/
- thot_experiment 1y agoOh maybe, I don't really use a phone to look up directions but I'll download it just in case.
- a2dam 1y agoI've been looking into doing this as a Home Assistant integration so I can put it in a little dashboard by the door. Can you describe how you built this a bit more? It's exactly the kind of data that should be easy to grab, but isn't.
- eschluntz 1y agohttps://github.com/eschluntz/eschluntz.github.io/blob/gh-pages/caltrain-data.js https://github.com/eschluntz/eschluntz.github.io/blob/gh-pag... copy and pasted into a spreadsheet from the website, then claude wrote a little script to convert it into js <no commitment that this file will stay up to date, use at your own risk, etc etc>
- rconti 1y agoI like how simple and minimalist this is! Another great similar solution is the Caltrain Companion iOS app. The main screen I use is "Arriving Trains" which uses your current location to tell you when the next trains arrive in each direction, how far along they are on their route, etc. The data is realtime.
- deleted 1y ago[deleted]
- redsh 1y agoWhat was the prompt and how are you hosting it? :)
- skyzouw 1y ago[flagged]