Transitland doesn't yet include URLs for GTFS-realtime feeds, but it's on the short list - see https://github.com/transitland/transitland/issues/77.
This project is written to be fairly agnostic to what API the GTFS and GTFS-realtime feed URLs come from. We're currently using TransitFeeds.com because it already has a directory of GTFS-realtime feeds, but I'd like to add Transitland as an option too.
Adding Transitland as an option to our project would mean mirroring the TransitFeedsDownloader class in a new TransitlandDownloader class.
TransitFeedsDownloader does the following:
- Gets a list of GTFS-realtime feeds from TransitFeeds.com, which each have a Location ID (defined by TransitFeeds.com), creates a subdirectory for that Location ID, and downloads the GTFS-realtime protocol buffer files for each URL to that directory
- Gets a list of GTFS feeds, and downloads each GTFS zip file if we have a corresponding GTFS-realtime feed for that same Location ID
So, we'd need to following a similar process for Transitland:
- Get a list of GTFS-realtime feed URLs, each of which has some identifier that links it to the corresponding GTFS data
- Get a list of GTFS feeds, each of which has some identifier that links it to the corresponding GTFS-realtime feeds
This could happen in a single API call, or several - the main requirement is that there is a link between the GTFS and GTFS-realtime feeds, and that we can easily download GTFS data only for agencies that have GTFS-realtime feeds. Note that GTFS-realtime feeds typically have 2-3 URLs, one for each TripUpdate, VehiclePositions, and ServiceAlerts.