Skip to content

Commit

Permalink
doc()
Browse files Browse the repository at this point in the history
  • Loading branch information
Caul58 committed Oct 13, 2018
1 parent 3ee1f05 commit 3bb1551
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Scriptable Elements

Scripts to use with Siri
Metro Madrid has launched a feature to know how long does the next metro train will takes to get to a station. With this scripts it's possible to integrate this functionality with Siri, asking for the waiting times.

To implement this for a concrete station, it's needed to implement a new script where indicates the number of the station, if Siri have to present UI with the information as a Table and a callback function where the complete information is passed as String.

```javascript
metroTiming(<Metro Station Number as String>, <Siri will present UI or not as bool>, <callback function>)
```

For example:

This script is used to Barrio del Pilar Station and Siri will speaks all the information returned by the request.

```javascript
let completionCallback = function(text){
Speech.speak(text)
}

metroTiming("902", false, completionCallback);
```

0 comments on commit 3bb1551

Please sign in to comment.