#!/bin/sh # bt.sh - bot.trade 공개 요약 읽기 도구 (읽기 전용, 키 없음). https://bot.trade/developers # 쓰는 법: sh bt.sh summary | posts [개수] | notices [개수] # 필요: curl (jq 가 있으면 보기 좋게). 이 스크립트는 아무것도 바꾸지 않고, 공개 API·MCP 를 GET/POST 로 읽기만 한다. # 출처: bot.trade · 참고용 · 투자 권유 아님 (분당 60회 한도) set -eu BASE="${BT_BASE:-https://bot.trade}" cmd="${1:-summary}" n="${2:-10}" case "$n" in ''|*[!0-9]*) echo "개수는 1~20 숫자" >&2; exit 2 ;; esac pretty() { if command -v jq >/dev/null 2>&1; then jq "$@"; else cat; fi; } mcp_call() { curl -fsS -X POST "$BASE/mcp" \ -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \ -H 'MCP-Protocol-Version: 2025-11-25' \ --data "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"$1\",\"arguments\":{\"limit\":$n}}}" } case "$cmd" in summary) curl -fsS "$BASE/api/public/v1/summary" | pretty . ;; posts) mcp_call get_latest_posts | pretty '.result.structuredContent.items[] | "\(.title) \(.url)"' -r ;; notices) mcp_call get_exchange_notices | pretty '.result.structuredContent.items[] | "[\(.source)] \(.title) \(.url)"' -r ;; *) echo "쓰는 법: sh bt.sh summary | posts [개수] | notices [개수]" >&2; exit 2 ;; esac