Play­ing around with the idea of Alexa Skills based on live data feeds, I cre­ated an Alexa Skill which an­nounces un­planned ser­vice changes of the New York City sub­way and bus lines, based on in­for­ma­tion pro­vided by the Met­ro­pol­i­tan Trans­porta­tion Au­thor­ity (MTA). This skill, named “New York Trans­port” and avail­able in Eng­lish and Ger­man, was now cer­ti­fied and has gone live.

The back­end code con­sists of an AWS Lambda func­tion based on Node.js and writ­ten in Type­Script. The code uses the MTA real-​time data feeds for in­di­vid­ual sub­way and bus lines, pro­vided in XML for­mat. The feed doc­u­ments are con­verted to the JSON for­mat for eas­ier han­dling and only un­planned ser­vice changes are used. The de­scrip­tions for each ser­vice change are then processed for speech out­put: ab­bre­vi­a­tions like Pkwy, Tpke, or Jct are re­placed with speak­able vari­ants, some un­nec­es­sary mes­sage parts are re­moved and spe­cial pro­nun­ci­a­tions are han­dled, which are unique to New York City like Hous­ton Street (pro­nounced: /haʊstən/). All mes­sages are then read, can be re­viewed in the Alexa app and are also shown on Echo de­vices with a dis­play.

To use this skill, you can nav­i­gate to the US Skill Store on ama­zon.com if you’re from the US or use the US lo­cale. Al­ter­na­tively, you can in­stall it from the Ger­man Skill Store on ama­zon.de if your Echo de­vices are con­fig­ured to Ger­man. Please mind, that all mes­sages from the MTA are in Eng­lish only and are not trans­lated to Ger­man. In both cases, the in­vo­ca­tion name is “New York Trans­port”. Al­ter­na­tively, it should be pos­si­ble to just say “Alexa, en­able New York Trans­port” to in­stall the skill. Ger­man users can use the word “ak­tiviere” in­stead of “en­able”.

Where to go from here

MTA real-​time data feeds
US Skill Store
Ger­man Skill Store