diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-15 23:25:39 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-15 23:25:39 +0900 |
| commit | 090cf7d92e8e660b1dccf8d64780bd2430660cbc (patch) | |
| tree | 7d066972e89a47ca36f87e1faebec3366c8c8a94 /official-site-scripts/list-events.sh | |
| parent | 0443c8c9972cbe792716cca193f7ad1ae64c0eda (diff) | |
Add official-site-2023-dev as git submodule at official-site/
- Move management scripts from official-site/ to official-site-scripts/
- Update CLAUDE.md paths accordingly
- Deploy key configured at ~/.ssh/mosquitone_official_site_deploy
with SSH alias github-mosquitone-official-site
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'official-site-scripts/list-events.sh')
| -rwxr-xr-x | official-site-scripts/list-events.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/official-site-scripts/list-events.sh b/official-site-scripts/list-events.sh new file mode 100755 index 0000000..d56aabf --- /dev/null +++ b/official-site-scripts/list-events.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +[ -f "$REPO_ROOT/.env" ] && set -a && source "$REPO_ROOT/.env" && set +a + +AWS_CLI="${AWS_CLI:-/tmp/awscli/aws/dist/aws}" +ENDPOINT="${APP_SYNC_ENDPOINT:?APP_SYNC_ENDPOINT not set}" +API_KEY="${APP_SYNC_API_KEY:?APP_SYNC_API_KEY not set}" + +QUERY='{ listEvents(limit: 200) { items { id type date title venueName published shortTitle ticketFee key } } }' + +curl -s -X POST "$ENDPOINT" \ + -H "Content-Type: application/json" \ + -H "x-api-key: $API_KEY" \ + -d "{\"query\": $(echo "$QUERY" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')}" \ +| python3 -c " +import json, sys +d = json.load(sys.stdin) +items = d['data']['listEvents']['items'] +items.sort(key=lambda x: x['date'] or '') +for e in items: + pub = '✓' if e['published'] else ' ' + print(f\"[{pub}] {e['date']} {e['title'][:50]:<50} {e['venueName'] or ''}\") +" |
