Added custom-license and custom-homepage flag support

This commit is contained in:
Lucas
2025-04-12 20:51:15 -07:00
parent 874257d652
commit 4d464f4079
2 changed files with 14 additions and 8 deletions

View File

@@ -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
`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

View File

@@ -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')