Skip to content

Allows for easily querying the mta service status txt/xml/html/wtf file

License

Notifications You must be signed in to change notification settings

zamiang/node-mta-service-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:"
  ]
}

About

Allows for easily querying the mta service status txt/xml/html/wtf file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published