Search Plugin for Anandtech using its own search engine

Unfortunately, I have zero knowledge on both xml and json.
I tried to figure it out by myself for couple of days, but I could not find any solution.

When I try to search with keyword “samsung” from Anandtech website’s search engine,
I get the url below:

https://www.anandtech.com/SearchResults?q=samsung

In addition, if I click on the next page icon of the search results,
I get the url below:

https://www.anandtech.com/SearchResults?CurrentPage=2&q=samsung&sort=date

I think I have to combine two urls in one plugin to get sufficient result on devonagent, but I have no clue how to combine them. (I tried to copy other plugins to use it as a scratchpad, but the provided urls were quite different, so I couldn’t successfully exploit this approach…)
When I use only one of the url form above in the devonagent’s plugin creator, I can only get partial results. (partial results means, around 20 final search results, while I get 34 page of results if I use website’s built in search engine.)

Please help me to find solution on this matter.
I would really like to build a ground knowledge from this case to work on other websites by myself.

There are two options:

  1. Create a new search set, add the URL anandtech.com/show/ to the “Sites” tab and change the mode from “Crawl” to “Search”

  2. Choose File > New Plugin, paste the following URL…


https://www.anandtech.com/SearchResults?CurrentPage=_agentOffset_&q=_agentQuery_&sort=date

…and then add this to the plugin’s code to get only the desired links:


	<key>LinksMatching</key>
	<string>*www.anandtech.com/show/*</string>

Thank you for your quick answer!
It helped me a lot to understand how it works.

However, I am wondering why my search using this plugin stops on page 4, every time.
I have modified my plugin to tackle this problem, but it didn’t work.
Now my plugin looks like this:



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>Searches the web using &lt;www.anandtech.com&gt;.</string>
	<key>EngineUrl</key>
	<string>https://www.anandtech.com/SearchResults?CurrentPage=_agentOffset_&amp;q=_agentQuery_&amp;sort=date</string>
	<key>Identifier</key>
	<string>www.anandtech.com</string>
	<key>Info</key>
	<string>Anandtech Plugin</string>
	<key>LinksMatching</key>
	<string>*www.anandtech.com/show/*</string>
	<key>Name</key>
	<string>Anandtech</string>
	<key>OffsetPerPage</key>
	<integer>1</integer>
	<key>Operators</key>
	<integer>59</integer>
	<key>ParseLinks</key>
	<true/>
	<key>ResultsPerPage</key>
	<integer>15</integer>
	<key>Start</key>
	<integer>1</integer>
	<key>Version</key>
	<string>1.0</string>
</dict>
</plist>


Log pane from search result window says searching stops on page 4.
As I mentioned earlier, the result page should be 34 (and each page contains 15 result except for 34th page.)
I am wondering what am I missing…

By default only up to 100 results are used. You can customize this by creating a search set, enabling your plugin and changing the number of results per plugin.