Git Product home page Git Product logo

gtfs-rt-printer's Introduction

gtfs-rt-printer

Utility that loads a GTFS-RT from a file or URL and prints the results. It includes extension support, such as for NYCT, and support for several methods of authentication.

Download

JAR file

Requirements

  • Java 8
  • for Java 7 see older release note: this does not support headers.

Usage

Loading from a URL

 $ java -jar gtfs-rt-printer-1.0.0.jar http://localhost:8001/tripUpdates
 
 loading http://localhost:8001/tripUpdates
 feed contains 459 messages
 trip {
   trip_id: "A20171105WKD_090150_4..S06R"
   start_date: "20180426"
   route_id: "4"
   [transit_realtime.nyct_trip_descriptor] {
     train_id: "04 1507+ WDL/UTI"
     is_assigned: true
     direction: SOUTH
   }
 }
 stop_time_update {
   arrival {
     time: 1524770508
   }
   departure {
     time: 1524770508
   }
   stop_id: "413S"
   [transit_realtime.nyct_stop_time_update] {
     scheduled_track: "1"
   }
 }
 ...

Loading from a file

$ java -jar gtfs-rt-printer-1.1.0.jar ../src/test/resources/bart.pb| head
  loading ../src/test/resources/bart.pb
  feed contains 42 entities
  trip {
    trip_id: "1010958SAT"
  }
  stop_time_update {
    stop_sequence: 17
    departure {
      delay: 120
      uncertainty: 30

Sending HTTP GET Headers

$ java -jar gtfs-rt-printer-1.0.0.jar -header 'Accept: application/x-google-protobuf' -header 'Authorization: apikey ' https://api.transport.nsw.gov.au/v1/gtfs/realtime/sydneytrains | head
loading https://api.transport.nsw.gov.au/v1/gtfs/realtime/sydneytrains
Setting header Accept:  application/x-google-protobuf
Setting header Authorization:  apikey 
feed contains 299 entities
trip {
  trip_id: "85-Z.1283.125.128.A.8.51118258"
  schedule_relationship: SCHEDULED
  route_id: "CMB_2c"
}
timestamp: 1525537117

Setting HTTP Username and Password

$ java -jar gtfs-rt-printer-1.1.0.jar -user username -password password http://www.rtd-denver.com/google_sync/TripUpdate.pb
$ java -jar gtfs-rt-printer-1.2.0.jar -user accessKey -password secretKey https://gtfsapi.metrarail.com/gtfs/raw/tripUpdates.dat

Note that reserved characters (e.g. , ! and & ) need to be escaped (e.g. \, \!, and \&)

gtfs-rt-printer's People

Contributors

laidig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.