mirror of
https://github.com/benbusby/whoogle-search
synced 2024-11-04 18:00:25 +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
e066a19411
commit
6c85468cd6
@ -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 New Issue
Block a user