mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Brutal check that this looks like a yunohost app
This commit is contained in:
parent
5ff9b77cb1
commit
0cd152242c
1 changed files with 10 additions and 1 deletions
|
@ -51,13 +51,22 @@ class UnlistedApp(db.Model):
|
|||
if item["name"] in known_apps:
|
||||
continue
|
||||
|
||||
owner = item["owner"]["login"]
|
||||
|
||||
r = requests.head("https://raw.githubusercontent.com/%s/%s/master/manifest.json" % (owner, item["name"]))
|
||||
if r.status_code != 200:
|
||||
continue
|
||||
r = requests.head("https://raw.githubusercontent.com/%s/%s/master/scripts/install" % (owner, item["name"]))
|
||||
if r.status_code != 200:
|
||||
continue
|
||||
|
||||
item["name"] = item["name"].replace("_ynh", "")
|
||||
|
||||
app = UnlistedApp(name=item["name"],
|
||||
url=item["html_url"],
|
||||
owner=item["owner"]["login"],
|
||||
description=item["description"],
|
||||
updated_days_ago=githubDateToDaysAgo(item["updated_at"])
|
||||
updated_days_ago=githubDateToDaysAgo(item["pushed_at"])
|
||||
)
|
||||
db.session.add(app)
|
||||
|
||||
|
|
Loading…
Reference in a new issue