Methods
-
loadFeed( callback )
-
Description
Load the MTA Transit Feed
Parameters
Name Type Description callbackfunction Callback function
Name Type Attributes Description errorError Transit Feed Error. The Error's message will be a pipe (|) separated string in the format of: Error Code|Error Type|Error Message that will be parsed out by the Right Track API Server into a more specific error Response.
feedTransitFeed <optional> The built Transit Feed for the MTA
Details
-
_findRoutes( agency_ids, route_id_matches, entities ) → {Array.<String>}
-
Description
Find matching MTA Route IDs given the specified Agency IDs and Route ID RegExps
Parameters
Name Type Description agency_idsArray.<String> MTA Agency IDs
route_id_matchesArray.<String> Regular Expressions for matching MTA Route IDs
entitiesArray.<Object> Parsed entities (from the MTA API)
Returns
Details
-
_buildEvents( agency_ids, route_id, entities ) → {Array.<TransitEvent>}
-
Description
Build the Transit Events for the specified Route ID
Parameters
Name Type Description agency_idsArray.<String> MTA Agency IDs
route_idString MTA Route ID
entitiesArray.<Object> Parsed entities (from the MTA API)
Returns
Details
-
_parseEntity( e ) → {Object|Boolean}
-
Description
Parse the MTA Alert Entity and retrieve the routes and event details for an entity that should be displayed in the Feed
Parameters
Name Type Description eObject Alert Entity
Returns
Details
-
_clean( html ) → {String}
-
Description
Clean the specified HTML
- set hidden sections as visible
- replace leading and trailing breaks
- replace empty links
Parameters
Name Type Description htmlString HTML to clean
Returns
Details
-
_parseTokens( details ) → {String}
-
Description
Find and replace icon tokens in the event details
Parameters
Name Type Description detailsString The details to parse
Returns
Details