ai-conversation-impact/www/repo-stats.sh
claude 728f7784d1 Add www/ directory to repository
Landing page, nginx config, analytics scripts, and cost updater
are now tracked in git. update-costs.sh writes to both the live
(/home/claude/www/) and repo copies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 15:41:54 +00:00

35 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Query Forgejo API for repository statistics
# No authentication needed for public repo data.
#
# Usage: ./repo-stats.sh
set -euo pipefail
BASE="http://127.0.0.1:3000/api/v1"
REPO="claude/ai-conversation-impact"
echo "=== Repository stats for $REPO ==="
echo
# Repo info
info=$(curl -s "$BASE/repos/$REPO")
stars=$(echo "$info" | python3 -c "import sys,json; print(json.load(sys.stdin).get('stars_count', 0))")
forks=$(echo "$info" | python3 -c "import sys,json; print(json.load(sys.stdin).get('forks_count', 0))")
watchers=$(echo "$info" | python3 -c "import sys,json; print(json.load(sys.stdin).get('watchers_count', 0))")
echo "Stars: $stars"
echo "Forks: $forks"
echo "Watchers: $watchers"
# Open issues
issues=$(curl -s "$BASE/repos/$REPO/issues?state=open&type=issues&limit=50")
issue_count=$(echo "$issues" | python3 -c "import sys,json; print(len(json.load(sys.stdin)))")
echo "Open issues: $issue_count"
echo
echo "=== Recent issues ==="
echo "$issues" | python3 -c "
import sys, json
issues = json.load(sys.stdin)
for i in issues[:10]:
print(f\" #{i['number']} {i['title']} ({i['created_at'][:10]})\")" 2>/dev/null || echo " (none)"