Skip to content

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

Added custom-license and custom-homepage flag support

Lucas4d464f4079d2
diff --git a/resources/DOCS.md b/resources/DOCS.md
index a291027..2ee2dd1 100644
--- a/resources/DOCS.md
+++ b/resources/DOCS.md
@@ -11,4 +11,8 @@
`💡` - Innovative: Projects that "invent" something new
### Flags
-`custom-description` - For apps whose description is not from GitHub so that the `stats_updator.py` script skips updating it
\ No newline at end of file
+`custom-description` - stats updator script skips updating the description
+
+`custom-license` - stats updator script skips updating the license
+
+`custom-homepage` - stats updator script skips updating the homepage
\ No newline at end of file
diff --git a/source/scripts/maintenance/stats_updator.py b/source/scripts/maintenance/stats_updator.py
index 436c8fc..ce788d2 100644
--- a/source/scripts/maintenance/stats_updator.py
+++ b/source/scripts/maintenance/stats_updator.py
@@ -29,19 +29,21 @@ def update_application_data(app):
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'])
- app['homepage_url'] = repo_data.get('homepage', app['homepage_url'])
+
+ if 'custom-homepage' not in app.get('flags', []):
+ app['homepage_url'] = repo_data.get('homepage', app['homepage_url'])
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:
- app['license'] = license_data.get('spdx_id', app['license'])
- else:
- app['license'] = app['license']
+ if 'custom-license' not in app.get('flags', []):
+ license_data = repo_data.get('license')
+ if license_data is not None:
+ app['license'] = license_data.get('spdx_id', app['license'])
+ else:
+ app['license'] = app['license']
app['last_commit'] = datetime.strptime(repo_data['pushed_at'], '%Y-%m-%dT%H:%M:%SZ').strftime('%m/%d/%Y')