Page 1 of 1

Making a Custom Search Engine

Posted: Fri Jan 04, 2019 4:43 pm
by Moffee
Hi! I recently switched over to using Codex over BDDatabase ever since I heard of the story about it, and since I'm starting to frequently visit BDO Codex, I wanted to add the website's search feature as a custom search engine in Chrome (I mention Chrome since I don't really know how other browsers would do it), but cannot do so, since the search engine uses POST requests. Is it possible to have another search engine or a modification so that it could be done?

I would usually do it, for example, Anime Tosho's search, with %s as my search query: https://animetosho.org/search/?q=%s
So, I also tried it with BDO Codex like this: https://bdocodex.com/us/search/?Search_Field=%s

But it doesn't work, probably because the underlying code checks only POST parameters. Is it possible to also make it check the GET parameters?

Thank you! I love the website, tons more over the other one.

Re: Making a Custom Search Engine

Posted: Fri Jan 04, 2019 11:44 pm
by Kiriak
Thanks for switching to my new site, Moffee! I really appreciate it!

As for the search, you can use these two urls to search with GET parameters:
https://bdocodex.com/query.php?a=search&l=us&sq=kzarka - this will give you full search results.
https://bdocodex.com/ac.php?l=us&term=kzarka - this will give you the more tidy ajax formatted results set without html mark up, but limited to 10 most relevant entries. It's used for the dropdown search results window.

Re: Making a Custom Search Engine

Posted: Sat Jan 05, 2019 3:15 am
by Moffee
Yeah, sure! Thanks for managing and working on the site!

Ooooooh, that's cool, but there isn't one that can lead straight to the search results?

Re: Making a Custom Search Engine

Posted: Sat Jan 05, 2019 9:05 am
by Kiriak
Moffee wrote:
Sat Jan 05, 2019 3:15 am
Ooooooh, that's cool, but there isn't one that can lead straight to the search results?
The first one should give you the full search results. Is it not enough for you?

Re: Making a Custom Search Engine

Posted: Sat Jan 05, 2019 2:32 pm
by Moffee
Kinda a bit different from what I expected since I was looking for something that would lead to https://bdocodex.com/us/search/, with a query (i.e. "kzarka") included. However, https://bdocodex.com/query.php?a=search&l=us&sq=kzarka leads to a JSON result, most of which appears to be HTML code, https://bdocodex.com/ac.php?l=us&term=kzarka is also indeed cleaner, but isn't exactly what I was looking for as well.

If I were to say, I'm mostly looking for something simpler that's basically https://bdocodex.com/us/search/ but accepts a GET parameter.

I could use the two URLs for a Chrome extension though (which is more complicated versus just plugging it in Chrome's "Manage Search Engines" under Settings), which can most likely be parsed, then turned into actual buttons and stuff, then linking straight to the BDO Codex entry with the provided link.

I'm sorry if I'm troubling you, just looking for a quicker way to get to search results from an empty new tab versus either having the tab always open, or going through the main page first.

Re: Making a Custom Search Engine

Posted: Sat Jan 05, 2019 8:54 pm
by Kiriak
Then please show me an example of the output you would like to see, because I don't quite get what do you want. https://bdocodex.com/us/search/ actually sends the search query as GET parameter to https://bdocodex.com/query.php?a=search&l=us&sq=kzarka, but it seems the results are not satisfactory for you. You can even use it like this btw: https://bdocodex.com/us/search/kzarka/.

Re: Making a Custom Search Engine

Posted: Sun Jan 06, 2019 1:34 am
by Moffee
Ohhh, that one! I was looking for https://bdocodex.com/us/search/kzarka/

Thank you so much!

Re: Making a Custom Search Engine

Posted: Sun Jan 06, 2019 8:52 am
by Kiriak
You welcome! :)