| name | roblox-game-data-scraper |
| description | 自动化抓取 Roblox 游戏数据的完整工具链。支持从 Trello、Discord、Reddit 和游戏内 API 收集代码、物品、角色、交易价值等结构化数据。 |
| keywords | roblox, data scraping, trello, discord, reddit, game data, automation |
Roblox Game Data Scraper - 游戏数据自动化抓取器
这个 skill 帮助你自动化收集 Roblox 游戏的所有核心数据,是内容生成的数据基础。
核心价值主张
手动从 Trello、Discord、Reddit 收集游戏数据需要数小时。这个 skill 能在 10 分钟内自动抓取并结构化所有数据,直接生成可用的 TypeScript 类型定义。
支持的数据源
1. Trello 看板 (官方数据)
- 游戏机制说明
- 物品属性和掉落率
- 角色技能数据
- 更新日志
2. Discord 频道 (实时更新)
3. Reddit 社区 (玩家智慧)
- 交易价值共识
- 隐藏机制发现
- 最佳构建分享
- 常见问题解答
4. 游戏内 API (如果可用)
数据输出格式
代码数据 (Codes)
interface GameCode {
code: string;
reward: string;
status: 'Active' | 'Expired';
expiryDate?: string;
requirements?: string;
source: 'Discord' | 'Twitter' | 'Trello';
verifiedDate: string;
}
export const jujutsuInfiniteCodes: GameCode[] = [
{
code: 'LUNAR_FAREWELL',
reward: '50 Spins',
status: 'Active',
expiryDate: '2026-03-22',
source: 'Discord',
verifiedDate: '2026-03-17'
}
];
物品数据 (Items)
interface GameItem {
id: string;
name: string;
category: 'Weapon' | 'Accessory' | 'Material' | 'Consumable';
rarity: 'Common' | 'Rare' | 'Legendary' | 'Mythical';
stats: Record<string, number>;
dropRate?: number;
obtainMethod: string[];
tradingValue?: string;
description: string;
}
export const items: GameItem[] = [
{
id: 'split-soul-katana',
name: 'Split Soul Katana',
category: 'Weapon',
rarity: 'Mythical',
stats: {
damage: 150,
speed: 1.2,
range: 5
},
dropRate: 0.0025,
obtainMethod: ['Soul Curse Raid', 'Craft at Zen Forest'],
tradingValue: '15 DF',
description: 'Legendary katana with soul-splitting abilities'
}
];
角色/技能数据 (Techniques)
interface Technique {
id: string;
name: string;
tier: 'S' | 'A' | 'B' | 'C' | 'D';
rarity: number;
moves: Move[];
domain?: DomainExpansion;
awakening?: Awakening;
pvpRating: number;
pveRating: number;
}
interface Move {
name: string;
damage: number;
cooldown: number;
ceConsumption: number;
description: string;
}
交易价值数据 (Trading Values)
interface TradeValue {
itemId: string;
itemName: string;
value: string;
demand: 'Hyped' | 'High' | 'Medium' | 'Low';
trend: 'Rising' | 'Stable' | 'Falling';
lastUpdated: string;
}
使用方法
场景 1: 为新游戏创建完整数据库
python resources/scraper_config.py --game "Your Bizarre Adventure" \
--trello "https://trello.com/b/..." \
--discord "https://discord.gg/..." \
--reddit "r/YourBizarreAdventure"
python resources/full_scraper.py --game yba --output ./data/yba/
python resources/generate_types.py --input ./data/yba/ --output ./src/data/yba/
场景 2: 监控代码更新
python resources/discord_monitor.py \
--channel-id "123456789" \
--keywords "code,codes,redeem" \
--webhook "https://your-site.com/api/new-code"
场景 3: 抓取 Reddit 交易价值
python resources/reddit_value_scraper.py \
--subreddit "QMGames" \
--keywords "trading,value,worth" \
--output ./data/trading_values.json
关键文件说明
resources/trello_scraper.py
从 Trello 看板抓取结构化数据:
def scrape_trello_board(board_url: str) -> dict:
"""
抓取 Trello 看板的所有卡片和列表
返回:
{
'items': [...],
'techniques': [...],
'mechanics': [...],
'changelog': [...]
}
"""
resources/discord_monitor.py
实时监控 Discord 频道:
import discord
class CodeMonitor(discord.Client):
async def on_message(self, message):
if 'code' in message.content.lower():
code = extract_code(message.content)
save_code(code)
trigger_deploy()
resources/reddit_crawler.py
爬取 Reddit 帖子和评论:
import praw
def scrape_subreddit(subreddit_name: str, keywords: list) -> list:
"""
搜索 Reddit 帖子并提取相关信息
返回:
[
{
'title': '...',
'content': '...',
'upvotes': 123,
'comments': [...]
}
]
"""
reddit = praw.Reddit(...)
subreddit = reddit.subreddit(subreddit_name)
resources/data_schemas/
TypeScript 类型定义模板:
data_schemas/
├── codes.schema.ts
├── items.schema.ts
├── techniques.schema.ts
├── trading_values.schema.ts
└── game_config.schema.ts
数据验证和清洗
自动验证规则
def validate_code_data(code: dict) -> bool:
"""验证代码数据的完整性"""
required_fields = ['code', 'reward', 'status']
return all(field in code for field in required_fields)
def validate_item_data(item: dict) -> bool:
"""验证物品数据的完整性"""
数据去重
def deduplicate_codes(codes: list) -> list:
"""
去除重复的代码
保留最新的验证日期
"""
seen = {}
for code in codes:
if code['code'] not in seen:
seen[code['code']] = code
elif code['verifiedDate'] > seen[code['code']]['verifiedDate']:
seen[code['code']] = code
return list(seen.values())
最佳实践
1. 设置定时任务
0 */6 * * * python resources/full_scraper.py --game jujutsu-infinite
0 */1 * * * python resources/discord_monitor.py --check-codes
0 0 * * 0 python resources/reddit_value_scraper.py --weekly-update
2. 数据版本控制
./data/
├── jujutsu-infinite/
│ ├── 2026-03-17/
│ │ ├── codes.json
│ │ ├── items.json
│ │ └── techniques.json
│ └── latest/
3. 错误处理
try:
data = scrape_trello_board(url)
except TrelloAPIError as e:
logger.error(f"Trello API 失败: {e}")
data = load_cached_data()
except Exception as e:
send_alert(f"抓取失败: {e}")
与现有项目集成
在 Next.js 项目中使用
import { jujutsuInfiniteCodes } from '@/data/jujutsu-infinite/codes';
import { items } from '@/data/jujutsu-infinite/items';
export default function CodesPage() {
return (
<div>
{jujutsuInfiniteCodes.map(code => (
<CodeCard key={code.code} {...code} />
))}
</div>
);
}
自动化部署流程
name: Update Game Data
on:
schedule:
- cron: '0 */6 * * *'
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- name: Scrape Data
run: python resources/full_scraper.py
- name: Generate Types
run: python resources/generate_types.py
- name: Commit Changes
run: |
git add data/
git commit -m "chore: update game data"
git push
- name: Trigger Deploy
run: curl -X POST ${{ secrets.DEPLOY_WEBHOOK }}
成功案例
案例 1: Jujutsu Infinite 完整数据库
- 数据源: Trello + Discord + Reddit
- 抓取时间: 8 分钟
- 数据量:
- 25 个代码
- 150+ 物品
- 30 个技能
- 200+ 交易价值
- 更新频率: 每 6 小时自动更新
案例 2: 实时代码监控
- 监控频道: 5 个 Discord 服务器
- 检测延迟: < 2 分钟
- 准确率: 98% (自动过滤假代码)
- 网站更新: 自动触发重新部署
扩展功能
1. 图片抓取
def scrape_item_images(item_name: str) -> str:
"""
从游戏 Wiki 或 Discord 抓取物品图片
自动下载并优化为 WebP 格式
"""
2. 视频教程提取
def extract_youtube_guides(keyword: str) -> list:
"""
搜索 YouTube 相关教程视频
提取视频 ID、标题、观看量
"""
3. 社区情绪分析
def analyze_community_sentiment(item_name: str) -> dict:
"""
分析 Reddit/Discord 对某物品的讨论
返回:
{
'sentiment': 'Positive' | 'Neutral' | 'Negative',
'hype_level': 0-100,
'common_opinions': [...]
}
"""
注意事项
法律和道德
- ✅ 遵守网站的 robots.txt
- ✅ 使用合理的请求频率 (避免 DDoS)
- ✅ 尊重 API 使用限制
- ✅ 标注数据来源
- ❌ 不要抓取付费内容
- ❌ 不要绕过登录验证
技术限制
- Discord: 需要 Bot Token (申请官方 Bot)
- Reddit: 需要 API Key (免费申请)
- Trello: 公开看板可直接抓取
- 动态内容: 可能需要 Selenium/Playwright
故障排查
问题 1: Discord Bot 无法连接
python -c "import discord; print(discord.__version__)"
问题 2: Reddit API 限流
reddit = praw.Reddit(
client_id='...',
client_secret='...',
user_agent='...',
ratelimit_seconds=600
)
问题 3: Trello 数据格式变化
def parse_trello_card(card):
try:
return extract_structured_data(card)
except Exception:
return fuzzy_extract(card)
准备好开始抓取数据了吗? 配置你的第一个游戏数据源,让 AI 自动收集所有信息!