0.0.1 • Published 8 years ago

mta-service-status v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Build Status

MTA Service Status

This project aims to make it easy to query the MTA service status file.

Currently, it allows you to query this crazy file by individual transit line and get back sane json.

var MTA = require('mta-service-status');

MTA.getServiceStatus('subway', 'C').then(function(result) {
    console.log(result);
})
/**
  result = {
    name: 'ACE'
    status: 'GOOD SERVICE'
    html: '',
    date: '03/29/2016'
    time: '11:23AM'
  };
**/

Future goals

Parse the html of service advisories to return real JSON

Go from

                  <span class="TitleServiceChange" >Service Change</span>
                  <span class="DateStyle">
                   Posted: 03/29/2016 10:18AM
                  </span>
                  <br/>
                  <br/>
                <P><STRONG>Bx4A</STRONG> westbound buses are detoured due to DEP work on Bergen Av between Westchester Av and E 149 St. </P>
<P>Detour is as follows:</P>
<P><STRONG>Westbound</STRONG>: Via E 149 St, bypass Bergen Av, right on Third Av, right on Westchester Av, take stand at far side of Bergen Av and terminate. </P>
<P>Allow additional travel time. </P>

To something like:

"warning": {
  "title": "Service Change",
  "date": "Posted: 03/29/201610:18AM"
  "textLines": [
    "Bx4A westbound buses are detoured due to DEP work on Bergen Av between Westchester Av and E 149 St.",
    "Detour is as follows:"
  ]
}