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>
This commit is contained in:
parent
cb9d62fb5b
commit
728f7784d1
5 changed files with 419 additions and 0 deletions
35
www/repo-stats.sh
Executable file
35
www/repo-stats.sh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/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)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue