mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-03-11 08:54:34 +00:00
Allow bang operator anywhere in query
Bang operator can now be placed anywhere in the query, to allow for peak efficiency in stream of consciousness querying (i.e. `big !reddit chungus` will search reddit for big chungus`). Fixes #196
This commit is contained in:
parent
64567a63ea
commit
ecb7885a56
1 changed files with 2 additions and 1 deletions
|
|
@ -71,8 +71,9 @@ class RoutingUtils:
|
|||
return self.query
|
||||
|
||||
def bang_operator(self, bangs_dict: dict) -> str:
|
||||
split_query = self.query.split(' ')
|
||||
for operator in bangs_dict.keys():
|
||||
if self.query.split(' ')[0] != operator:
|
||||
if operator not in split_query:
|
||||
continue
|
||||
|
||||
return bangs_dict[operator]['url'].format(
|
||||
|
|
|
|||
Loading…
Reference in a new issue