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'
};
**/
Go from
<span class="TitleServiceChange" >Service Change</span>
<span class="DateStyle">
&nbsp;Posted:&nbsp;03/29/2016&nbsp;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:"
]
}