Skip to content

Kaputt4/scriptable-widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scriptable Widgets

Compilation of different scripts developed by me for Scriptable iOS app.

CodeQL

TFL Near Stations

This widget uses Transport for London Unified API, and presents the nearest transport stations, the next trains and their destination. In order to use it, you have to register to obtain a app_key. In order to obtain the key, you have to subscribe to 500 Requests per min product in Products tab.

Usage

There are two ways of importing this widget into your device:

  1. Import the widget using ScriptDude with the button below.

Download with ScriptDude

  1. Create a new widget manually and copy the content of the file tfl-near-stations.js into it.

Variables

Three variables can be customized:

  1. const app_key = "API-TOKEN-HERE" ➡️ TFL API primary or secondary key, obtained after registering in their website. It's required that this token is included in the variable. The API can be used as anonymously for testing purposes, but it works much more slowly, requests can't be tracked and getting the token is just free.

    You can use either the primary key or your secondary key in the app_key parameter. There are two keys because you can use them in different apps, and if you need to revoke one key, then the apps using the other key can continue working.

  2. const stop_modes = ["tube", "elizabeth-line", "dlr"] ➡️ Stations modes, obtained from TFL StopPoint API.

    Available modes are: ["bus", "cable-car", "coach", "cycle", "cycle-hire", "dlr", "elizabeth-line", "interchange-keep-sitting", "interchange-secure", "national-rail", "overground", "replacement-bus", "river-bus", "river-tour", "taxi", "tram", "tube", "walking"]

  3. const radius = 1000 ➡️ Radius in meters from current location where stations will be searched.

About

Compilation of different scripts developed by me for Scriptable iOS app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published