diff --git a/.github/workflows/discordmessage.yml b/.github/workflows/discordmessage.yml index 234e843..068b908 100644 --- a/.github/workflows/discordmessage.yml +++ b/.github/workflows/discordmessage.yml @@ -54,6 +54,7 @@ jobs: CI_LINK="" + # secrets.DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1138292630699118733/-9QfspX7aBxiVYRKgyf70eBNBpCG6EhLWNHnEmdFsUmkx24RgTj3i-TkfR4ttiocUomh" if [ ! -z "$DISCORD_ID" ]; then MESSAGE="The CI from <@$DISCORD_ID>'s commit has failed, please check: $CI_LINK" diff --git a/GithubAPI/fetch_top_repos.py b/GithubAPI/fetch_top_repos.py new file mode 100644 index 0000000..c7b28c1 --- /dev/null +++ b/GithubAPI/fetch_top_repos.py @@ -0,0 +1,49 @@ +import requests +import time +import json + +def fetch_repos(language, api_token, max_repos=1000): + """Fetch top repos for a given language from the GitHub API.""" + repos = [] + page = 1 + headers = {'Authorization': f'token {api_token}'} + + while len(repos) < max_repos: + url = f'https://api.github.com/search/repositories?q=language:{language}&sort=stars&order=desc&page={page}&per_page=100' + response = requests.get(url, headers=headers) + + if response.status_code != 200: + print(f"Failed to fetch page {page} of repos for {language} with status code {response.status_code}") + break + + data = response.json()['items'] + repos.extend(data) + + if len(data) < 100: + break + + page += 1 + time.sleep(0.5) # So we don't get rate limited + + if len(repos) >= max_repos: + print(f"Fetched {len(repos)} repos for {language}") + repos = repos[:max_repos] + + return repos + +def save_repos_to_file(repos, language): + """Save the repos to a file.""" + with open(f'{language}_repos.json', 'w') as file: + json.dump(repos, file, indent=4) + +api_token= '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' +languages = ['Python', 'Rust', 'C', 'JavaScript'] + +for language in languages: + print(f"Fetching top repos for {language}") + top_repos = fetch_repos(language, api_token) + print(f"Fetched {len(top_repos)} repos for {language}") + + print(f"Saving repos to file for {language}") + save_repos_to_file(top_repos, language) + diff --git a/ansible/README.md b/Infra/ansible/README.md similarity index 100% rename from ansible/README.md rename to Infra/ansible/README.md diff --git a/ansible/playbooks/.vscode/settings.json b/Infra/ansible/playbooks/.vscode/settings.json similarity index 100% rename from ansible/playbooks/.vscode/settings.json rename to Infra/ansible/playbooks/.vscode/settings.json diff --git a/ansible/playbooks/start-script-stop.yml b/Infra/ansible/playbooks/start-script-stop.yml similarity index 100% rename from ansible/playbooks/start-script-stop.yml rename to Infra/ansible/playbooks/start-script-stop.yml diff --git a/ansible/playbooks/stop b/Infra/ansible/playbooks/stop similarity index 100% rename from ansible/playbooks/stop rename to Infra/ansible/playbooks/stop diff --git a/ansible/playbooks/stop-instance.yml b/Infra/ansible/playbooks/stop-instance.yml similarity index 100% rename from ansible/playbooks/stop-instance.yml rename to Infra/ansible/playbooks/stop-instance.yml diff --git a/ansible/playbooks/test-kindelia-cargobuild.yml b/Infra/ansible/playbooks/test-kindelia-cargobuild.yml similarity index 100% rename from ansible/playbooks/test-kindelia-cargobuild.yml rename to Infra/ansible/playbooks/test-kindelia-cargobuild.yml diff --git a/dockerfiles/Dockerfile b/Infra/dockerfiles/Dockerfile similarity index 100% rename from dockerfiles/Dockerfile rename to Infra/dockerfiles/Dockerfile diff --git a/terraform/bucket-creation/bucket.tf b/Infra/terraform/bucket-creation/bucket.tf similarity index 100% rename from terraform/bucket-creation/bucket.tf rename to Infra/terraform/bucket-creation/bucket.tf diff --git a/terraform/bucket-creation/provider.tf b/Infra/terraform/bucket-creation/provider.tf similarity index 100% rename from terraform/bucket-creation/provider.tf rename to Infra/terraform/bucket-creation/provider.tf diff --git a/terraform/bucket-creation/variables.tf b/Infra/terraform/bucket-creation/variables.tf similarity index 100% rename from terraform/bucket-creation/variables.tf rename to Infra/terraform/bucket-creation/variables.tf diff --git a/scripts/README.md b/Tools/README.md similarity index 100% rename from scripts/README.md rename to Tools/README.md diff --git a/scripts/python/img-to-video.py b/Tools/img-to-video.py similarity index 100% rename from scripts/python/img-to-video.py rename to Tools/img-to-video.py diff --git a/scripts/python/img-to-video2.py b/Tools/img-to-video2.py similarity index 100% rename from scripts/python/img-to-video2.py rename to Tools/img-to-video2.py diff --git a/scripts/python/img_to_gif.py b/Tools/img_to_gif.py similarity index 100% rename from scripts/python/img_to_gif.py rename to Tools/img_to_gif.py diff --git a/scripts/python/py.py b/Tools/mp4-to-gif.py similarity index 100% rename from scripts/python/py.py rename to Tools/mp4-to-gif.py diff --git a/scripts/python/ytb-to-whisper.py b/Tools/ytb-to-whisper.py similarity index 100% rename from scripts/python/ytb-to-whisper.py rename to Tools/ytb-to-whisper.py diff --git a/scripts/actions/cargo.yml b/scripts/actions/cargo.yml deleted file mode 100644 index 55be386..0000000 --- a/scripts/actions/cargo.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cargo Check | Test | Build - -# This workflow run tests and build for each push - -on: - push: - branches: - - master - -jobs: - - test_phaser: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Update local toolchain - run: | - rustup update - rustup install nightly - - - name: Toolchain info - run: | - cargo --version --verbose - rustc --version - - - name: Test - run: | - cargo check - cargo test --all - - - name: Build - run: - cargo build --release