Use the bundled script to answer Hong Kong bus route + stop queries and MTR heavy rail station + direction queries quickly and consistently.
Run the bundled script from the skill directory:
Legacy bus invocation still works:
bash
python3 scripts/hk_bus_eta.py <route> <stop-keyword>
Equivalent explicit subcommand:
bash
python3 scripts/hk_bus_eta.py bus <route> <stop-keyword>
Examples:
bash
python3 scripts/hk_bus_eta.py 74X 九龍灣
python3 scripts/hk_bus_eta.py bus A41 青衣 --operator lwb
python3 scripts/hk_bus_eta.py bus 20 啟德 --operator citybus
python3 scripts/hk_bus_eta.py bus 20 "Kai Tak" --operator citybus --direction outbound
python3 scripts/hk_bus_eta.py bus 74X 九龍灣 --direction outbound
python3 scripts/hk_bus_eta.py bus 74X 九龍灣 --json
Structured station-to-station query:
bash
python3 scripts/hk_bus_eta.py mtr <origin-station> <destination-station>
Natural-language prompt parsing:
bash
python3 scripts/hk_bus_eta.py mtr-text "火炭站去金鐘方向幾點有車"
Examples:
bash
python3 scripts/hk_bus_eta.py mtr 火炭 金鐘
python3 scripts/hk_bus_eta.py mtr 火炭 金鐘 --line EAL
python3 scripts/hk_bus_eta.py mtr-text "火炭站去金鐘方向幾點有車"
python3 scripts/hk_bus_eta.py mtr-text "金鐘去北角下一班港島線幾時"
python3 scripts/hk_bus_eta.py mtr-text "荃灣站往中環方向有冇車" --json
Or use an absolute path rooted at the installed skill folder if needed.
74X, A41, 20, NA31.74X 九龍灣幾耐到, A41 青衣站有冇車, 城巴20啟德幾時到 as route + place queries.九巴 → --operator kmb龍運 / Long Win → --operator lwb城巴 / Citybus → --operator citybus--operator citybus.去機場, 往尖沙咀, outbound, 返去 often imply direction disambiguation.--direction outbound or --direction inbound when the user's wording clearly prefers one side.Detect that the prompt is station + destination/direction based, not bus-route based.
X站去Y方向, X去Y下一班, 往Y有冇車, X站到Y幾點有車.Extract the origin station and target station/direction anchor.
火炭站去金鐘方向幾點有車 → origin 火炭, target 金鐘金鐘去北角下一班港島線幾時 → origin 金鐘, target 北角, line hint ISL荃灣站往中環方向有冇車 → origin 荃灣, target 中環If the message names a line, pass it as --line.
東鐵線 → EAL港島線 → ISL荃灣線 → TWL觀塘線 → KTL將軍澳線 → TKL屯馬線 → TML東涌線 → TCL機場快綫 / Airport Express → AEL南港島線 → SIL迪士尼線 → DRLPrefer mtr-text when the user phrased the request naturally and it fits the built-in patterns.
If parsing feels ambiguous, use mtr <origin> <destination> directly instead of guessing from a messy sentence.
The script resolves line/station mapping from the official MTR lines-and-stations CSV, then filters trains from the official MTR schedule endpoint that actually pass the requested target station.
If multiple line candidates remain, list them instead of pretending certainty.
74X 喺九龍灣下一班大約 3 分鐘後到。 or 火炭去金鐘方向下一班東鐵線大約 2 分鐘後到,4 號月台。--json only when structured output is easier for follow-up processing.kmb: official data.etabus.gov.hk KMB endpoints.lwb: handled through the same KMB-family endpoint structure used by Long Win routes in the KMB dataset.citybus: official rt.data.gov.hk/v2/transport/citybus endpoints.mtr: official rt.data.gov.hk/v1/transport/mtr/getSchedule.php endpoint plus the official MTR lines/stations CSV from opendata.mtr.com.hk.mtr-text handles common natural-language forms like X站去Y方向幾點有車, X去Y下一班, and X往Y有冇車; unusual phrasings may need manual extraction with mtr <origin> <destination>.scripts/hk_bus_eta.py — query KMB/LWB/Citybus bus ETA, and MTR heavy rail ETA using either structured station arguments or a short natural-language MTR prompt.