HinaCortus commited on
Commit
97c72c7
1 Parent(s): 1c58145

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- request = "website"
57
  listsocialnetwork = ['facebook', 'youtube', 'myspace', 'linkedin', 'twitter', 'instagram', 'github',
58
  'reddit', 'picterest', 'discord', '']
59
- link_split = request.split('/')
60
- for part in link_split:
61
- if part in listsocialnetwork:
62
- website = "found"
 
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}