Skip to content

Commit

Permalink
[Webserver] Options suppl.
Browse files Browse the repository at this point in the history
Tous les parametres sur les modules, comme `verif` et `site`
sont maintenant disponible en les envoyant en parametre via l'url

ex: /pdf/gaetan?site=iteam-s.mg
  • Loading branch information
gaetan1903 committed Jan 19, 2022
1 parent ad13fac commit f34b51b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ You can use the parameter `limit` to limit results
]
```
##### Note: `site` and `verif` parameter in module can be given in url parameter
`curl http://<host>:<port>/pdf/statut?verif=false&site=iteam-s.mg`


</details>
Expand Down
2 changes: 1 addition & 1 deletion bin/websearch
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def websearch(ext, query):
limit = 100
try:
query = query.replace('+', ' ')
web = WebSearch(query)
web = WebSearch(query, **dict(request.args))
if ext == 'pages':
res = WebSearch(query).pages
elif ext == 'images':
Expand Down
4 changes: 2 additions & 2 deletions websearch/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WebSearch:
'User-Agent': 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'
}

def __init__(self, query, verif=True, **kwargs):
def __init__(self, query, **kwargs):
# verifier si la recherche est de type mutliple.
if isinstance(query, list):
self.query = "'"
Expand All @@ -35,7 +35,7 @@ def __init__(self, query, verif=True, **kwargs):
self.query = f"site:{kwargs.get('site')} {self.query}"

# Utiliser pour la verification des liens.
self.verif = verif
self.verif = kwargs.get('verif', True)
# utiliser pour l'optimisation
self.__data = {}

Expand Down

0 comments on commit f34b51b

Please sign in to comment.