Skip to content

The definitive list of the best of (consumer facing) open source.

Replaces | in description and added flag checks

Lucas2c9c1d599ac3
diff --git a/source/scripts/generators/contents_generator.py b/source/scripts/generators/contents_generator.py
index 0641afc..cd1c49b 100644
--- a/source/scripts/generators/contents_generator.py
+++ b/source/scripts/generators/contents_generator.py
@@ -96,7 +96,7 @@ def generate_contents(platform="all"):
apps = apps_by_subcat.get(sub["id"], [])
for app in apps:
name = app.get("name", "")
- description = app.get("description", "")
+ description = app.get("description", "").replace("|", "-")
link = app.get("link", "#")
tags = ""
"""
diff --git a/source/scripts/maintenance/stats_updator.py b/source/scripts/maintenance/stats_updator.py
index 0ceebfc..37c2652 100644
--- a/source/scripts/maintenance/stats_updator.py
+++ b/source/scripts/maintenance/stats_updator.py
@@ -16,18 +16,25 @@ headers = {
def update_application_data(app):
repo_name = app["link"].split("github.com/")[1]
+
+
repo_url = f'https://api.github.com/repos/{repo_name}'
print(f"Updating: {repo_name}")
print(f"API URL: {repo_url}")
+
response = requests.get(repo_url, headers=headers)
if response.status_code == 200:
repo_data = response.json()
+
app['stars'] = repo_data.get('stargazers_count', app['stars'])
app['language'] = repo_data.get('language', app['language'])
+
+ if 'custom-description' not in app.get('flags', []):
+ app['description'] = repo_data.get('description', app.get('description'))
license_data = repo_data.get('license')
if license_data is not None:
@@ -40,7 +47,7 @@ def update_application_data(app):
return app
else:
print(f"Error: Unable to fetch data for {repo_name}. Status Code: {response.status_code}") # Print status code
- print(f"Response: {response.text}")
+ print(f"Response: {response.text}") # Print response content for more insight
return app
for app in data['applications']: