Skip to content

Commit e10747b

Browse files
committed
Merge branch 'update-db009-fork'
2 parents f8be3ac + 2b364f6 commit e10747b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1246
-161
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Update Subscriber Count
2+
3+
on:
4+
schedule:
5+
# Run every hour
6+
- cron: '0 * * * *'
7+
workflow_dispatch: # Allow manual trigger
8+
9+
jobs:
10+
update-count:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Fetch subscriber count from ConvertKit public page
22+
id: fetch-count
23+
run: |
24+
# Try to fetch from public stats page
25+
# Note: This URL pattern might need adjustment based on ConvertKit's public stats
26+
STATS_URL="https://app.convertkit.com/forms/8269255/stats"
27+
28+
# For now, we'll need the API key since public stats aren't easily scrapeable
29+
# If you find a public endpoint, replace this section
30+
if [ -n "${{ secrets.CONVERTKIT_API_SECRET }}" ]; then
31+
# Get form subscribers using the correct endpoint
32+
RESPONSE=$(curl -s "https://api.convertkit.com/v3/forms/8269255/subscriptions?api_secret=${{ secrets.CONVERTKIT_API_SECRET }}")
33+
echo "API Response: $RESPONSE"
34+
COUNT=$(echo $RESPONSE | jq -r '.total_subscriptions // 0')
35+
else
36+
# Fallback: increment existing count (not ideal but works without API)
37+
if [ -f subscriber-count.json ]; then
38+
COUNT=$(cat subscriber-count.json | jq -r '.count // 1')
39+
else
40+
COUNT=1
41+
fi
42+
fi
43+
44+
# Update the JSON file
45+
echo "{
46+
\"count\": $COUNT,
47+
\"lastUpdated\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
48+
}" > subscriber-count.json
49+
50+
echo "Subscriber count: $COUNT"
51+
echo "count=$COUNT" >> $GITHUB_OUTPUT
52+
53+
- name: Update Gist with subscriber count
54+
run: |
55+
# Create or update gist with subscriber count
56+
GIST_ID="${{ secrets.GIST_ID }}"
57+
58+
# Prepare the JSON content
59+
JSON_CONTENT=$(cat subscriber-count.json | jq -c . | sed 's/"/\\"/g')
60+
61+
if [ -z "$GIST_ID" ]; then
62+
echo "Creating new gist..."
63+
RESPONSE=$(curl -s -X POST \
64+
-H "Authorization: Bearer ${{ secrets.GIST_TOKEN }}" \
65+
-H "Accept: application/vnd.github.v3+json" \
66+
-H "Content-Type: application/json" \
67+
https://api.github.com/gists \
68+
-d "{
69+
\"description\": \"Bitworld subscriber count\",
70+
\"public\": true,
71+
\"files\": {
72+
\"subscriber-count.json\": {
73+
\"content\": \"$JSON_CONTENT\"
74+
}
75+
}
76+
}")
77+
78+
echo "Full API Response: $RESPONSE"
79+
80+
NEW_GIST_ID=$(echo $RESPONSE | jq -r '.id // empty')
81+
if [ -n "$NEW_GIST_ID" ] && [ "$NEW_GIST_ID" != "null" ]; then
82+
echo "Created gist with ID: $NEW_GIST_ID"
83+
echo "Add this as GIST_ID secret in your repository"
84+
echo "Gist URL: https://gist.github.com/$NEW_GIST_ID"
85+
else
86+
echo "Failed to create gist. Check if GIST_TOKEN has 'gist' scope."
87+
echo "Error details: $(echo $RESPONSE | jq -r '.message // empty')"
88+
exit 1
89+
fi
90+
else
91+
# Update existing gist
92+
echo "Updating existing gist: $GIST_ID"
93+
UPDATE_RESPONSE=$(curl -s -X PATCH \
94+
-H "Authorization: Bearer ${{ secrets.GIST_TOKEN }}" \
95+
-H "Accept: application/vnd.github.v3+json" \
96+
-H "Content-Type: application/json" \
97+
https://api.github.com/gists/$GIST_ID \
98+
-d "{
99+
\"files\": {
100+
\"subscriber-count.json\": {
101+
\"content\": \"$JSON_CONTENT\"
102+
}
103+
}
104+
}")
105+
106+
if echo "$UPDATE_RESPONSE" | jq -e '.id' > /dev/null; then
107+
echo "Successfully updated gist: https://gist.github.com/$GIST_ID"
108+
else
109+
echo "Failed to update gist"
110+
echo "Error: $(echo $UPDATE_RESPONSE | jq -r '.message // empty')"
111+
exit 1
112+
fi
113+
fi

CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Instructions for Claude
2+
3+
## Commands to avoid
4+
- Do not run `npm start` - the user will handle starting the development server
5+
6+
## Documentation
7+
- When the user asks for instructions or setup steps, provide them directly in the conversation
8+
- Do not create markdown files for instructions unless explicitly requested

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Simworld
1+
# bitworld.gg
22

3-
A 2D simulation game built with Phaser.js featuring an animated character in a multi-story building environment.
3+
A pixel life simulation where you live, explore, and make friends in a growing city.
44

55
## Quick Start
66

@@ -16,10 +16,6 @@ A 2D simulation game built with Phaser.js featuring an animated character in a m
1616

1717
3. Open `http://localhost:8080` in your browser
1818

19-
## Controls
20-
21-
- **A/D**: Move left/right
22-
2319
## Assets
2420

2521
This project uses the [Pixel Spaces - 2D Life-Sim/Room Building Asset Pack](https://netherzapdos.itch.io/pixel-spaces) by Netherzapdos for room building and life simulation assets.

0 commit comments

Comments
 (0)