Linz Public Transport
Use this skill to interact with Linz Linien EFA endpoints:
Read endpoint details in {baseDir}/references/endpoints.md before implementation.
Use {baseDir}/scripts/linz_transport.py as the default execution path.
Workflow
- 1. Resolve the API base URL.
- Run the script subcommand that matches the task.
- Return a compact, user-facing summary.
Primary Tooling
- - Script path: INLINECODE4
- Runtime: Python 3, standard library only.
- Base URL input:
-
--base-url <url> argument, or
-
LINZ_TRANSPORT_API_BASE_URL environment variable, or
- default
http://www.linzag.at/linz2.
Preferred commands:
-
python {baseDir}/scripts/linz_transport.py stops "taubenmarkt"
- - Fetch departures by stop ID:
-
python {baseDir}/scripts/linz_transport.py departures --stop-id 60501160 --limit 10
- - Resolve stop and fetch departures in one call:
- INLINECODE10
Step 1: Resolve Base URL
- - Use user-provided base URL first.
- Otherwise use
LINZ_TRANSPORT_API_BASE_URL if available. - If neither exists, use
http://www.linzag.at/linz2.
Step 2: Present Output
- - Sort by
countdownInMinutes ascending if needed. - Show the next 5-10 departures unless user asks for more.
- Include both relative (
countdownInMinutes) and absolute (time) times. - Keep field names stable when returning JSON.
Error Handling
- - If stop search returns empty list, suggest nearby spellings and retry with a shorter query token.
- If multiple stop matches are returned, rerun with explicit
--stop-id or use next ... --pick-first only when ambiguity is acceptable. - If departures response is empty, state that no upcoming departures are currently available.
- If HTTP request fails, report status code, endpoint, and retry guidance.
- If EFA response includes a
message code, include that code in diagnostics.
Minimal Examples
CODEBLOCK0
CODEBLOCK1
林茨公共交通
使用此技能与林茨林茨线路EFA端点进行交互:
- - GET /efa/XMLSTOPFINDERREQUEST
- GET /efa/XMLDMREQUEST
在实现前,请阅读{baseDir}/references/endpoints.md中的端点详情。
使用{baseDir}/scripts/linz_transport.py作为默认执行路径。
工作流程
- 1. 解析API基础URL。
- 运行与任务匹配的脚本子命令。
- 返回简洁、面向用户的摘要。
主要工具
- - 脚本路径:{baseDir}/scripts/linz_transport.py
- 运行环境:Python 3,仅使用标准库。
- 基础URL输入:
- --base-url
参数,或
- LINZTRANSPORTAPIBASEURL环境变量,或
- 默认值http://www.linzag.at/linz2
推荐命令:
- python {baseDir}/scripts/linz_transport.py stops taubenmarkt
- python {baseDir}/scripts/linz_transport.py departures --stop-id 60501160 --limit 10
- python {baseDir}/scripts/linz_transport.py next taubenmarkt --limit 10 --pick-first
第一步:解析基础URL
- - 优先使用用户提供的基础URL。
- 否则使用LINZTRANSPORTAPIBASEURL(如果可用)。
- 如果两者都不存在,则使用http://www.linzag.at/linz2。
第二步:呈现输出
- - 如有需要,按countdownInMinutes升序排序。
- 除非用户要求更多,否则显示接下来5-10班发车信息。
- 同时包含相对时间(countdownInMinutes)和绝对时间(time)。
- 返回JSON时保持字段名称稳定。
错误处理
- - 如果站点搜索返回空列表,建议附近拼写并使用更短的查询词重试。
- 如果返回多个匹配站点,使用明确的--stop-id重新运行,或仅在歧义可接受时使用next ... --pick-first。
- 如果发车响应为空,说明当前没有即将发车的班次。
- 如果HTTP请求失败,报告状态码、端点和重试指导。
- 如果EFA响应包含message代码,在诊断中包含该代码。
最小示例
bash
python {baseDir}/scripts/linz_transport.py stops taubenmarkt
python {baseDir}/scripts/linz_transport.py departures --stop-id 60501160 --limit 10
python {baseDir}/scripts/linz_transport.py next taubenmarkt --limit 10 --pick-first
powershell
python {baseDir}/scripts/linz_transport.py stops taubenmarkt
python {baseDir}/scripts/linz_transport.py departures --stop-id 60501160 --limit 10
python {baseDir}/scripts/linz_transport.py next taubenmarkt --limit 10 --pick-first