← 返回
AI智能 中文

MLB Daily Scores

Daily MLB baseball scores, box scores, starting pitchers, and injury reports for your favourite team. Covers spring training, regular season, and playoffs. R...
每日 MLB 比赛比分、技术统计、先发投手和伤情报告。涵盖春季训练、常规赛和季后赛。
jeremydouglaslaw-ui
AI智能 clawhub v1.0.13 1 版本 100000 Key: 无需
★ 1
Stars
📥 726
下载
💾 15
安装
1
版本
#latest

概述

MLB Daily Scores

Fetches yesterday's game recap and today's upcoming game preview for the user's configured favourite MLB team. Includes spring training, regular season, postseason (Wild Card, Division Series, Championship Series, World Series), and exhibition games.

Data Source

Uses the free MLB Stats API (statsapi.mlb.com). No API key required.

Setup (one-time)

1. Install dependencies

Run the setup script to install the Python packages:

# macOS/Linux
bash {baseDir}/setup.sh

# Any platform (including Windows)
python {baseDir}/setup.py

Or install manually:

pip install --user MLB-StatsAPI requests

2. Configure your team

Add this to ~/.openclaw/openclaw.json under skills.entries:

{
  skills: {
    entries: {
      "mlb-daily-scores": {
        enabled: true,
        config: {
          team: "Toronto Blue Jays", // Your favourite team (full name)
          timezone: "America/Toronto", // Your local timezone (IANA format)
        },
      },
    },
  },
}

Valid team names — use the full official name:

Arizona Diamondbacks, Atlanta Braves, Baltimore Orioles, Boston Red Sox, Chicago Cubs, Chicago White Sox, Cincinnati Reds, Cleveland Guardians, Colorado Rockies, Detroit Tigers, Houston Astros, Kansas City Royals, Los Angeles Angels, Los Angeles Dodgers, Miami Marlins, Milwaukee Brewers, Minnesota Twins, New York Mets, New York Yankees, Oakland Athletics, Philadelphia Phillies, Pittsburgh Pirates, San Diego Padres, San Francisco Giants, Seattle Mariners, St. Louis Cardinals, Tampa Bay Rays, Texas Rangers, Toronto Blue Jays, Washington Nationals.

3. Set up the daily cron job

Ask me to set it up, or run manually:

openclaw cron add \
  --name "MLB Daily Scores" \
  --cron "0 6 * * *" \
  --tz "America/Toronto" \
  --session isolated \
  --message "Run the mlb-daily-scores skill for my configured team. Use the fetch_mlb.py script, format the results nicely, and include yesterday's recap, today's preview, and any injuries." \
  --announce \
  --channel discord \
  --to "channel:YOUR_CHANNEL_ID"

Adjust the parameters:

  • --cron "0 6 *" — time to run (6:00 AM); change to your preferred time
  • --tz — your timezone
  • --channel — your preferred channel (discord, telegram, whatsapp, slack, etc.)
  • --to — channel-specific target (channel ID, phone number, chat ID, etc.)

How to use

Automatic (cron)

Once the cron job is set up, the skill runs daily at your configured time and delivers the report to your channel.

On demand (slash command)

Send /mlb-daily-scores in any chat to get an immediate update.

Manual invocation

Ask me: _"What happened in the Blue Jays game yesterday?"_ or _"Give me today's MLB update"_

Instructions for the agent

{baseDir} in these instructions refers to the directory containing this SKILL.md file. Determine this path from the location of this file (e.g., if this file is at /home/openclaw/.openclaw/workspace/skills/mlb-daily-scores/skills/mlb-daily-scores/SKILL.md, then {baseDir} is /home/openclaw/.openclaw/workspace/skills/mlb-daily-scores/skills/mlb-daily-scores).

When this skill is invoked (via cron, slash command, or user request):

  1. Determine the base directory — find the directory where this SKILL.md and fetch_mlb.py are located. Call this BASEDIR.
  1. Read the user's config from skills.entries.mlb-daily-scores.config:
    • team: the MLB team name (required)
    • timezone: IANA timezone string (optional, defaults to system timezone)
  1. Run the fetch script using this EXACT command pattern (replacing BASEDIR with the actual path):

```bash

BASEDIR/.venv/bin/python3 BASEDIR/fetch_mlb.py --config

```

IMPORTANT: You MUST use the venv Python at BASEDIR/.venv/bin/python3. Do NOT use python, python3, or any other Python interpreter — the required packages are only installed inside the .venv virtual environment. Using any other Python will fail with import errors.

The --config flag tells the script to read team/timezone directly from ~/.openclaw/openclaw.json. No user values should be interpolated into the command string. This outputs JSON to stdout.

  1. Parse the JSON output and check has_data:
    • If has_data is false and there's no error: it's off-season or a day off. Reply with HEARTBEAT_OK (this suppresses the message in cron/heartbeat mode).
    • If has_data is false and there's an error field: report the error to the user.
    • If has_data is true: format the report as described below.
  1. Format the report using this structure (include game_type from the JSON when it is not Regular Season):
⚾ MLB Daily Report — [Team Name]
📅 [Today's Date]

━━━━━━━━━━━━━━━━━━━━━━━
📊 YESTERDAY'S RECAP [game_type, e.g. "(Spring Training)" — omit if Regular Season]
━━━━━━━━━━━━━━━━━━━━━━━

[Score Line, e.g.: Blue Jays 5, Yankees 3]

  W: [Winning Pitcher]
  L: [Losing Pitcher]
  S: [Save Pitcher, if any]

LINE SCORE:
[Linescore text from the API]

━━━━━━━━━━━━━━━━━━━━━━━
🔮 TODAY'S PREVIEW [game_type, e.g. "(Spring Training)" — omit if Regular Season]
━━━━━━━━━━━━━━━━━━━━━━━

[Opponent] @ [Home Team]
🕐 [Game Time in local timezone]
🏟️ [Venue]

Starting Pitchers:
  [Away Team]: [Pitcher Name] ([W-L], [ERA] ERA)
  [Home Team]: [Pitcher Name] ([W-L], [ERA] ERA)

━━━━━━━━━━━━━━━━━━━━━━━
🏥 INJURY REPORT
━━━━━━━━━━━━━━━━━━━━━━━

[For each injury]:
• [Player Name] ([Position]) — [Injury Description] [Status]

[If no injuries]: ✅ No players currently on the injury list.
  1. Omit sections that have no data:
    • No yesterday game → skip the recap section, note "No game yesterday"
    • No today game → skip the preview section, note "No game scheduled today"
    • No injuries → show the clean bill of health line
  1. Keep the box score concise — include the linescore (innings R/H/E) but NOT the full box score text (it's too long for chat). Only include the full boxscore if the user explicitly asks for more detail.
  1. Off-season handling — If neither yesterday nor today has a game and there are no injuries to report, respond with just HEARTBEAT_OK so no message is delivered. The script covers all game types (spring training, regular season, postseason, exhibition), so true off-season gaps are only mid-November through late February.

版本历史

共 1 个版本

  • v1.0.13 当前
    2026-03-29 20:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 709 📥 243,559
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 834 📥 212,824
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,056 📥 796,430