?BB Scotty:奥地利铁路旅行与行程规划 - Openclaw Skills

作者:互联网

2026-04-13

AI快讯

什么是 ?BB Scotty 铁路规划助手?

此技能为 ?BB Scotty 系统提供程序化接口,该系统是奥地利联邦铁路(?BB)的主要出行信息服务。通过利用 HAFAS mgate API,它使 AI 代理能够搜索车站、规划复杂的多段行程并获取实时车站信息板。它是 Openclaw Skills 生态系统中为需要奥地利铁路、巴士和有轨电车网络高保真交通数据的用户提供的核心工具。

除了简单的行程规划外,该技能还处理技术细节,如针对不同交通类型(从 Railjet 高铁到 S-Bahn 通勤线)的产品掩码。它还提供对 HimSearch 服务的访问,该服务可提供有关轨道关闭、技术故障和座位减少的实时预警。

下载入口:https://github.com/openclaw/skills/tree/main/skills/manmal/oebb-scotty

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install oebb-scotty

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 oebb-scotty。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

?BB Scotty 铁路规划助手 应用场景

  • 规划具有特定出发或到达时间限制的奥地利城市间的铁路旅程。
  • 获取特定车站(如维也纳中央车站)的实时出发时刻表,以检查站台变更。
  • 监控特定地区或交通产品的服务警报和中断信息。
  • 将车站名称和地址解析为唯一的地点 ID,以实现精确的交通路由。
?BB Scotty 铁路规划助手 工作原理
  1. 该技能使用 LocMatch 方法将用户提供的车站名称或地址解析为唯一的、系统兼容的地点 ID (lid)。
  2. 对于行程规划,它使用这些 ID 以及格式化的日期 (YYYYMMDD) 和时间 (HHMMSS) 参数构建 TripSearch 请求。
  3. 请求应用产品过滤掩码,以包含或排除特定的交通模式,如 Nightjet、城际列车或当地巴士。
  4. HAFAS API 返回详细的 JSON 响应,包含行程路段、持续时间和站台信息。
  5. 该技能将内部产品索引 (prodX) 映射到实际列车名称(例如 S7 或 RJX 662),以提供易于阅读的旅行行程摘要。

?BB Scotty 铁路规划助手 配置指南

要使用此技能,请确保您的代理可以向 ?BB mgate 端点执行 POST 请求。除了配置中提供的公共 AID 之外,不需要额外的外部 API 密钥。

# 验证车站搜索连接性
curl -s -X POST "https://fahrplan.oebb.at/bin/mgate.exe" r
  -H "Content-Type: application/json" r
  -d '{"id":"1","ver":"1.67","auth":{"type":"AID","aid":"OWDL4fE4ixNiPBBm"},"client":{"id":"OEBB","type":"WEB"},"svcReqL":[{"req":{"input":{"field":"S","loc":{"name":"Salzburg Hbf","type":"S"}}},"meth":"LocMatch"}]}'

?BB Scotty 铁路规划助手 数据架构与分类体系

该技能使用以下分类整理数据:

数据类型 格式/键 描述
车站 ID lid 地点的唯一字符串标识符(例如 A=1@O=Wien Hbf...)
外部 ID extId 奥地利交通的标准 7 位车站代码
日期 YYYYMMDD 所有查询的标准日期格式
时间 HHMMSS 包含秒的 24 小时制时间格式
产品掩码 整数 代表交通类型的位总和(例如 S-Bahn 为 32)
name: oebb-scotty
description: Austrian rail travel planner (?BB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ?BB trains, S-Bahn, regional trains, and connections to neighboring countries.

?BB Scotty API

Query Austria's public transport for trip planning, station departures, and service alerts via the HAFAS mgate API.

Quick Reference

Method Purpose
LocMatch Search for stations/stops by name
TripSearch Plan a journey between two locations
StationBoard Get departures/arrivals at a station
HimSearch Get service alerts and disruptions

Base URL: https://fahrplan.oebb.at/bin/mgate.exe


Authentication

All requests require these headers in the JSON body:

{
  "id": "1",
  "ver": "1.67",
  "lang": "deu",
  "auth": {"type": "AID", "aid": "OWDL4fE4ixNiPBBm"},
  "client": {"id": "OEBB", "type": "WEB", "name": "webapp", "l": "vs_webapp"},
  "formatted": false,
  "svcReqL": [...]
}

1. Location Search (LocMatch)

Search for stations, stops, addresses, or POIs by name.

Request

curl -s -X POST "https://fahrplan.oebb.at/bin/mgate.exe" r
  -H "Content-Type: application/json" r
  -d '{
    "id":"1","ver":"1.67","lang":"deu",
    "auth":{"type":"AID","aid":"OWDL4fE4ixNiPBBm"},
    "client":{"id":"OEBB","type":"WEB","name":"webapp","l":"vs_webapp"},
    "formatted":false,
    "svcReqL":[{
      "req":{"input":{"field":"S","loc":{"name":"Wien Hbf","type":"ALL"},"maxLoc":10}},
      "meth":"LocMatch"
    }]
  }'

Response Structure

{
  "svcResL": [{
    "res": {
      "match": {
        "locL": [{
          "lid": "A=1@O=Wien Hbf (U)@X=16377950@Y=48184986@U=181@L=1290401@",
          "type": "S",
          "name": "Wien Hbf (U)",
          "extId": "1290401",
          "crd": { "x": 16377950, "y": 48184986 },
          "pCls": 6015
        }]
      }
    }
  }]
}

Location Types

Type Description
S Station/Stop
A Address
P POI (Point of Interest)

Key Fields

Field Description
lid Location ID string (use in TripSearch)
extId External station ID
name Station name
crd.x/y Coordinates (x=lon, y=lat, scaled by 10^6)
pCls Product class bitmask

2. Trip Search (TripSearch)

Plan a journey between two locations.

Request

curl -s -X POST "https://fahrplan.oebb.at/bin/mgate.exe" r
  -H "Content-Type: application/json" r
  -d '{
    "id":"1","ver":"1.67","lang":"deu",
    "auth":{"type":"AID","aid":"OWDL4fE4ixNiPBBm"},
    "client":{"id":"OEBB","type":"WEB","name":"webapp","l":"vs_webapp"},
    "formatted":false,
    "svcReqL":[{
      "req":{
        "depLocL":[{"lid":"A=1@O=Wien Hbf@L=8103000@","type":"S"}],
        "arrLocL":[{"lid":"A=1@O=Salzburg Hbf@L=8100002@","type":"S"}],
        "jnyFltrL":[{"type":"PROD","mode":"INC","value":"1023"}],
        "getPolyline":false,
        "getPasslist":true,
        "outDate":"20260109",
        "outTime":"080000",
        "outFrwd":true,
        "numF":5
      },
      "meth":"TripSearch"
    }]
  }'

Parameters

Param Description
depLocL Departure location(s) - use lid from LocMatch
arrLocL Arrival location(s)
outDate Departure date (YYYYMMDD)
outTime Departure time (HHMMSS)
outFrwd true = search forward, false = search backward
numF Number of connections to return
jnyFltrL Product filter (see below)
getPasslist Include intermediate stops

Product Filter Values

Bit Value Product
0 1 ICE/RJX (High-speed)
1 2 IC/EC (InterCity)
2 4 NJ (Night trains)
3 8 D/EN (Express)
4 16 REX/R (Regional Express)
5 32 S-Bahn
6 64 Bus
7 128 Ferry
8 256 U-Bahn
9 512 Tram

Use 1023 for all products, or sum specific bits.

Response Structure

{
  "svcResL": [{
    "res": {
      "outConL": [{
        "date": "20260109",
        "dur": "025200",
        "chg": 0,
        "dep": {
          "dTimeS": "075700",
          "dPltfS": {"txt": "8A-B"}
        },
        "arr": {
          "aTimeS": "104900",
          "aPltfS": {"txt": "7"}
        },
        "secL": [{
          "type": "JNY",
          "jny": {
            "prodX": 0,
            "dirTxt": "Salzburg Hbf",
            "stopL": [...]
          }
        }]
      }],
      "common": {
        "locL": [...],
        "prodL": [...]
      }
    }
  }]
}

Key Connection Fields

Field Description
dur Duration (HHMMSS)
chg Number of changes
dTimeS Scheduled departure
dTimeR Real-time departure (if available)
aTimeS Scheduled arrival
aTimeR Real-time arrival (if available)
dPltfS.txt Departure platform
aPltfS.txt Arrival platform
secL Journey sections (legs)
secL[].jny.prodX Index into common.prodL[] for train name

Understanding prodX (Product Index)

Important: The prodX field in journey sections is an index into the common.prodL[] array, NOT the train name itself. To get the actual train name (e.g., "S7", "RJX 662"), you must look up common.prodL[prodX].name.

Extracting Trip Summaries with jq

The raw TripSearch response is very verbose. Use this jq filter to extract a concise summary with resolved train names:

curl -s -X POST "https://fahrplan.oebb.at/bin/mgate.exe" r
  -H "Content-Type: application/json" r
  -d '{ ... }' | jq '
    .svcResL[0].res as $r |
    $r.common.prodL as $prods |
    [$r.outConL[] | {
      dep: .dep.dTimeS,
      arr: .arr.aTimeS,
      depPlatform: .dep.dPltfS.txt,
      arrPlatform: .arr.aPltfS.txt,
      dur: .dur,
      chg: .chg,
      legs: [.secL[] | select(.type == "JNY") | {
        train: $prods[.jny.prodX].name,
        dir: .jny.dirTxt,
        dep: .dep.dTimeS,
        arr: .arr.aTimeS,
        depPlatform: .dep.dPltfS.txt,
        arrPlatform: .arr.aPltfS.txt
      }]
    }]'

Example output:

[
  {
    "dep": "213900",
    "arr": "221100",
    "depPlatform": "1",
    "arrPlatform": "3A-B",
    "dur": "003200",
    "chg": 0,
    "legs": [{"train": "S 7", "dir": "Flughafen Wien Bahnhof", "dep": "213900", "arr": "221100", ...}]
  }
]

3. Station Board (StationBoard)

Get departures or arrivals at a station.

Request

curl -s -X POST "https://fahrplan.oebb.at/bin/mgate.exe" r
  -H "Content-Type: application/json" r
  -d '{
    "id":"1","ver":"1.67","lang":"deu",
    "auth":{"type":"AID","aid":"OWDL4fE4ixNiPBBm"},
    "client":{"id":"OEBB","type":"WEB","name":"webapp","l":"vs_webapp"},
    "formatted":false,
    "svcReqL":[{
      "req":{
        "stbLoc":{"lid":"A=1@O=Wien Hbf@L=8103000@","type":"S"},
        "date":"20260109",
        "time":"080000",
        "type":"DEP",
        "maxJny":20
      },
      "meth":"StationBoard"
    }]
  }'

Parameters

Param Description
stbLoc Station location
date Date (YYYYMMDD)
time Time (HHMMSS)
type DEP (departures) or ARR (arrivals)
maxJny Maximum number of journeys

Response Structure

{
  "svcResL": [{
    "res": {
      "jnyL": [{
        "prodX": 0,
        "dirTxt": "Salzburg Hbf",
        "stbStop": {
          "dTimeS": "080000",
          "dPltfS": {"txt": "8A-B"}
        }
      }],
      "common": {
        "prodL": [{
          "name": "RJX 662",
          "cls": 1,
          "prodCtx": {"catOutL": "Railjet Xpress"}
        }]
      }
    }
  }]
}

4. Service Alerts (HimSearch)

Get current disruptions and service information.

Request

curl -s -X POST "https://fahrplan.oebb.at/bin/mgate.exe" r
  -H "Content-Type: application/json" r
  -d '{
    "id":"1","ver":"1.67","lang":"deu",
    "auth":{"type":"AID","aid":"OWDL4fE4ixNiPBBm"},
    "client":{"id":"OEBB","type":"WEB","name":"webapp","l":"vs_webapp"},
    "formatted":false,
    "svcReqL":[{
      "req":{
        "himFltrL":[{"type":"PROD","mode":"INC","value":"255"}],
        "maxNum":20
      },
      "meth":"HimSearch"
    }]
  }'

Response Structure

{
  "svcResL": [{
    "res": {
      "msgL": [{
        "hid": "HIM_FREETEXT_843858",
        "head": "Verringertes Sitzplatzangebot",
        "text": "Wegen einer technischen St?rung...",
        "prio": 0,
        "sDate": "20260108",
        "eDate": "20260108"
      }]
    }
  }]
}

Common Station IDs

Station extId
Wien Hbf 8103000
Wien Meidling 8100514
Wien Westbahnhof 8101003
Salzburg Hbf 8100002
Linz Hbf 8100013
Graz Hbf 8100173
Innsbruck Hbf 8100108
Klagenfurt Hbf 8100085
St. P?lten Hbf 8100008
Wr. Neustadt Hbf 8100516

Time Format

  • Dates: YYYYMMDD (e.g., 20260109)
  • Times: HHMMSS (e.g., 080000 = 08:00:00)
  • Duration: HHMMSS (e.g., 025200 = 2h 52m)

Error Handling

Check err field in response:

{
  "err": "OK",           // Success
  "err": "PARSE",        // Invalid request format
  "err": "NO_MATCH",     // No results found
  "errTxt": "..."        // Error details
}

Product Classes (cls values)

cls Product
1 ICE/RJX
2 IC/EC
4 Night trains
8 NJ/EN
16 REX/Regional
32 S-Bahn
64 Bus
128 Ferry
256 U-Bahn
512 Tram
1024 On-demand
2048 Other

相关推荐