diff --git a/.gitignore b/.gitignore index 96c0ecc..e95df97 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -docs/ \ No newline at end of file +docs/ +.env +*.env \ No newline at end of file diff --git a/fetch_github_data.sh b/fetch_github_data.sh new file mode 100755 index 0000000..7b3766b --- /dev/null +++ b/fetch_github_data.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# fetch_github_data.sh - Retrieves live data for the Demon-Die GitHub organization +# Requires jq to be installed. + +# Load the PAT from .env (strip spaces around =) +ENV_FILE="$(dirname "$0")/.env" +if [[ ! -f "$ENV_FILE" ]]; then + echo "Error: .env file not found" + exit 1 +fi +# Extract token value (supports spaces around =) +TOKEN=$(grep -E "^GIT_DEMONDIE_ALL" "$ENV_FILE" | cut -d'=' -f2- | tr -d ' \"') +if [[ -z "$TOKEN" ]]; then + echo "Error: GitHub token not found in .env" + exit 1 +fi +ORG="Demon-Die" + +# ------------------------------------------------------------ +# Fetch organization repositories (first 100, pagination if needed) +REPOS=$(curl -s -H "Authorization: token $TOKEN" "https://api.github.com/orgs/$ORG/repos?per_page=100") +PROJECT_COUNT=$(echo "$REPOS" | jq length) +TOTAL_STARS=$(echo "$REPOS" | jq '[.[] .stargazers_count] | add') +# Build repos array with needed fields +REPOS_DATA=$(echo "$REPOS" | jq '[.[] | {name: .name, description: .description, stars: .stargazers_count, html_url: .html_url}]') + +# ------------------------------------------------------------ +# Aggregate all unique contributors across all repositories using JSON array merging +ALL_CONTRIBS="[]" +for REPO_NAME in $(echo "$REPOS" | jq -r '.[].name'); do + PAGE=1 + while true; do + ContribResp=$(curl -s -H "Authorization: token $TOKEN" "https://api.github.com/repos/$ORG/$REPO_NAME/contributors?per_page=100&page=$PAGE") + COUNT=$(echo "$ContribResp" | jq length) + if [[ $COUNT -eq 0 ]]; then + break + fi + # Merge this page's contributors into the accumulator (ensure array) + ALL_CONTRIBS=$(printf '%s +%s' "$ALL_CONTRIBS" "$ContribResp" | jq -s 'add') + ((PAGE++)) + done +done + +# Deduplicate contributors +UNIQUE_CONTRIBS=$(echo "$ALL_CONTRIBS" | jq 'unique_by(.login)') +# Fetch org members and ensure it's an array +ORG_MEMBERS_RAW=$(curl -s -H "Authorization: token $TOKEN" "https://api.github.com/orgs/$ORG/members?per_page=100") +ORG_MEMBERS=$(echo "$ORG_MEMBERS_RAW" | jq 'if type=="array" then . else [. ] end') +# Merge contributors and org members, deduplicate again +ALL_USERS=$(printf '%s +%s' "$UNIQUE_CONTRIBS" "$ORG_MEMBERS" | jq -s 'add | unique_by(.login)') +PRIORITY_LOGINS=("RishiByte" "Pranav00076" "SharanyoBanerjee" "Yuvraj-Sarathe") +MEMBERS_DATA="[]" +# Add priority members first +for LOGIN in "${PRIORITY_LOGINS[@]}"; do + MATCH=$(echo "$ALL_USERS" | jq -c ".[] | select(.login == \"$LOGIN\")") + if [[ -n "$MATCH" ]]; then + # Ensure MATCH is an array before adding + MATCH_ARRAY=$(echo "$MATCH" | jq -c '[.]') + MEMBERS_DATA=$(printf '%s\n%s' "$MEMBERS_DATA" "$MATCH_ARRAY" | jq -s 'add') + fi +done +# Add remaining members +REMAINING=$(echo "$ALL_USERS" | jq -c --argjson p "$(printf '%s\n' "${PRIORITY_LOGINS[@]}" | jq -R . | jq -s .)" '[.[] | select(.login as $l | $p | index($l) | not)]') +MEMBERS_DATA=$(printf '%s\n%s' "$MEMBERS_DATA" "$REMAINING" | jq -s 'add') + +CONTRIBUTOR_COUNT=$(echo "$MEMBERS_DATA" | jq length) + +# ------------------------------------------------------------ +# Output summary JSON +cat > "$(dirname "$0")/github_summary.json" < deployed_code
-
12+
+
7
Active Projects
@@ -218,7 +218,7 @@

group
-
500+
+
63
Students Engaged
@@ -227,7 +227,7 @@

architecture
-
100+
+
2
Contributors
@@ -236,7 +236,7 @@

visibility
-
25K+
+
9
Repository Stars
@@ -336,83 +336,69 @@

Projects Explorer
- -
-folder -
-
DemonDie-Next-Frame
-
Modern web app boilerplate
-
-
-star 128 -
-
- -
-folder -
-
derronie.ai
-
AI-learning platform
-
-
-star 96 -
-
- -
-folder -
-
Campus-OS
-
Campus management system
-
-
-star 84 -
-
- -
-folder -
-
devtools
-
Developer tools pack by students
-
-
-star 72 -
-
- -
-folder -
-
microlearn
-
Micro learning platform
-
-
-star 64 -
-
- -
-folder -
-
SkillX
-
Skill exchange hub
-
-
-star 58 -
-
- -
-folder -
-
Attend-AI
-
Smart attendance
-
-
-star 48 -
-
+ +
+ folder +
+
CNTRL
+
An AI-powered desktop browser built with Tauri, Rust, and TypeScript — featuring hybrid local/cloud AI routing, smart navigation, and webview rendering.
+
+
star 0
+
+ +
+ folder +
+
.github
+
+
+
star 0
+
+ +
+ folder +
+
Website
+
DemonDie is an open-source technology community building impactful software and helping developers grow through collaboration.
+
+
star 2
+
+ +
+ folder +
+
DemonTechRoadmap
+
Community-driven roadmaps for students and aspiring developers.
+
+
star 5
+
+ +
+ folder +
+
UnVibe
+
UnVibe trains developers to truly understand code, not just generate it. AI writes the hardest solution — you decode it, rebuild it simpler, then defend your understanding in interviews. Your \"Irreplaceability Score\" tracks your depth. Goal: be skilled enough that no company can replace you with a prompt.
+
+
star 1
+
+ +
+ folder +
+
Certifier
+
Auto issuing badges for Contributors
+
+
star 0
+
+ +
+ folder +
+
SyncCanvas
+
SyncCanvas is an AI-powered collaborative whiteboard for real-time brainstorming, diagramming, and team collaboration on an infinite canvas. 🚀
+
+
star 1
+
@@ -503,52 +489,32 @@

Co View all contributors arrow_forward -
- -
-
- -
-
-
-
Rishi
-
Founder
-
-
-
- -
-
- -
-
-
Yuvraj
-
18 PRs
-
Maintainer
-
-
- -
-
- -
-
-
Sharanyo
-
15 PRs
-
Maintainer
-
-
- -
-
- -
-
-
Pranav
-
12 PRs
-
Maintainer
-
-
+ +
+ +