This commit is contained in:
deathbybandaid 2019-09-23 09:46:18 -04:00
parent d2441d7c7d
commit 9afa434b17
5 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,8 @@ from .Config import config as botconfig
from .Read import read as botread from .Read import read as botread
from .Commands import commands as botcommands from .Commands import commands as botcommands
from .Logs import logs
# TODO add a cache flush # TODO add a cache flush
@ -100,11 +102,12 @@ class Search():
# url base # url base
url = str(searchdict["url"]) url = str(searchdict["url"])
# query # query
url += str(self.valid_api[searchdict["query_type"]]) + str(searchdict["query"]) url += str(self.valid_api[searchdict["query_param"]]) + str(searchdict["query"])
# nsfw search? TODO # nsfw search? TODO
# additional parts # additional parts
if "additional_url" in list(self.valid_api[searchdict["query_type"]].keys()): if "additional_url" in list(self.valid_api[searchdict["query_type"]].keys()):
url += str(self.valid_api[searchdict["query_type"]]['additional_url']) url += str(self.valid_api[searchdict["query_type"]]['additional_url'])
logs.log('SpiceBot_Search', str(url))
return url return url

View File

@ -1,4 +1,5 @@
{ {
"url": "http://www.google.com/maps/place/", "url": "http://www.google.com/maps/place/",
"query": '', "query": '',
"query_param": '',
} }

View File

@ -1,5 +1,5 @@
{ {
"url": "http://www.google.com/search?", "url": "http://www.google.com/search?",
"query": 'q=', "query_param": 'q=',
"additional_url": "&btnI", "additional_url": "&btnI",
} }

View File

@ -1,4 +1,4 @@
{ {
"url": "http://community.spiceworks.com/search?", "url": "http://community.spiceworks.com/search?",
"query": 'query=', "query_param": 'query=',
} }

View File

@ -1,5 +1,5 @@
{ {
"url": "http://www.youtube.com/search?", "url": "http://www.youtube.com/search?",
"query": 'q=', "query_param": 'q=',
"additional_url": "&btnI", "additional_url": "&btnI",
} }