diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-10 01:16:27 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-06-10 01:16:27 +0900 |
| commit | d083ff9083f0901e5651190c3ad720f41d5b3065 (patch) | |
| tree | b11d49bf70f4ae1b6ab13d6116784af4e5bcaa64 /official-site/list-events.sh | |
Initial setup: mosquitone-admin with official-site management scripts
Add AppSync event CRUD scripts and agent docs for managing the Gatsby/Amplify
official site (www.mosquit.one). Include 2026-06-27 cre4m sod4 event data.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'official-site/list-events.sh')
| -rwxr-xr-x | official-site/list-events.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/official-site/list-events.sh b/official-site/list-events.sh new file mode 100755 index 0000000..0093875 --- /dev/null +++ b/official-site/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="https://APP_SYNC_ENDPOINT_REDACTED/graphql" +API_KEY="${APP_SYNC_API_KEY:-APP_SYNC_API_KEY_REDACTED}" + +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 ''}\") +" |
