Making a Custom Search Engine

Here you can ask your questions and post suggestions about site's development.
Post Reply
Moffee
Posts: 4
Joined:Fri Dec 21, 2018 12:12 am

Making a Custom Search Engine

Post by Moffee » Fri Jan 04, 2019 4:43 pm

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.

User avatar
Kiriak
Site Admin
Posts: 545
Joined:Wed Sep 11, 2013 10:30 am
Discord:Kiriak#5590

Re: Making a Custom Search Engine

Post by Kiriak » Fri Jan 04, 2019 11:44 pm

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.

Moffee
Posts: 4
Joined:Fri Dec 21, 2018 12:12 am

Re: Making a Custom Search Engine

Post by Moffee » Sat Jan 05, 2019 3:15 am

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?

User avatar
Kiriak
Site Admin
Posts: 545
Joined:Wed Sep 11, 2013 10:30 am
Discord:Kiriak#5590

Re: Making a Custom Search Engine

Post by Kiriak » Sat Jan 05, 2019 9:05 am

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?

Moffee
Posts: 4
Joined:Fri Dec 21, 2018 12:12 am

Re: Making a Custom Search Engine

Post by Moffee » Sat Jan 05, 2019 2:32 pm

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.

User avatar
Kiriak
Site Admin
Posts: 545
Joined:Wed Sep 11, 2013 10:30 am
Discord:Kiriak#5590

Re: Making a Custom Search Engine

Post by Kiriak » Sat Jan 05, 2019 8:54 pm

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/.

Moffee
Posts: 4
Joined:Fri Dec 21, 2018 12:12 am

Re: Making a Custom Search Engine

Post by Moffee » Sun Jan 06, 2019 1:34 am

Ohhh, that one! I was looking for https://bdocodex.com/us/search/kzarka/

Thank you so much!

User avatar
Kiriak
Site Admin
Posts: 545
Joined:Wed Sep 11, 2013 10:30 am
Discord:Kiriak#5590

Re: Making a Custom Search Engine

Post by Kiriak » Sun Jan 06, 2019 8:52 am

You welcome! :)

Post Reply