Spaces:
Runtime error
Runtime error
Commit
·
97c72c7
1
Parent(s):
1c58145
Update app.py
Browse files
app.py
CHANGED
@@ -51,15 +51,15 @@ def TopicClassification(payload: TextIn):
|
|
51 |
# https://hinacortus-api-knowyouraudience.hf.space/whichsocial/myspace
|
52 |
@app.get("/whichsocial/{request}")
|
53 |
def whichsocial(request):
|
54 |
-
website = "npt found"
|
55 |
if ('http' in request or 'https' in request or 'www' in request or '.com' in request or '.fr' in request):
|
56 |
-
|
57 |
listsocialnetwork = ['facebook', 'youtube', 'myspace', 'linkedin', 'twitter', 'instagram', 'github',
|
58 |
'reddit', 'picterest', 'discord', '']
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
socialnetwork = 'TikTok'
|
64 |
userprofile = 'me'
|
65 |
return {"request": request, "website":website, "social_network": socialnetwork, "user_profile": userprofile}
|
|
|
51 |
# https://hinacortus-api-knowyouraudience.hf.space/whichsocial/myspace
|
52 |
@app.get("/whichsocial/{request}")
|
53 |
def whichsocial(request):
|
|
|
54 |
if ('http' in request or 'https' in request or 'www' in request or '.com' in request or '.fr' in request):
|
55 |
+
website = "ok"
|
56 |
listsocialnetwork = ['facebook', 'youtube', 'myspace', 'linkedin', 'twitter', 'instagram', 'github',
|
57 |
'reddit', 'picterest', 'discord', '']
|
58 |
+
for socialnetwork in listsocialnetwork:
|
59 |
+
if socialnetwork in request:
|
60 |
+
socialnetwork = socialnetwork
|
61 |
+
else:
|
62 |
+
website = "it's not a website link !"
|
63 |
socialnetwork = 'TikTok'
|
64 |
userprofile = 'me'
|
65 |
return {"request": request, "website":website, "social_network": socialnetwork, "user_profile": userprofile}
|