Debugging a Plugin

Hi. I’ve got a plugin that returns zero results, listed below. I’d like to make a few plugins for my work, so while I’d love some specific help on this one, I’d appreciate some general debugging hints even more.

Thanks for any help!

-ls


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>GarageGames2 search plugin</string>
	<key>EngineURL</key>
	<string>http://search.garagegames.com/search?restrict=&amp;ie=&amp;q=_agentQuery_&amp;site=GarageGames&amp;output=xml_no_dtd&amp;client=GarageGames&amp;btnG=Google+Search&amp;access=p&amp;btnG.y=0&amp;lr=&amp;btnG.x=0&amp;proxystylesheet=GarageGames&amp;oe=&amp;start=_agentOffset_</string>
	<key>Identifier</key>
	<string>edu.vt.cs.deimos.GarageGames</string>
	<key>Info</key>
	<string>GarageGames search engine (c) Lally Singh</string>
	<key>LinksEnd</key>
	<string>&lt;/div&gt;&lt;center&gt;</string>
	<key>LinksStart</key>
	<string>&lt;div&gt;</string>
	<key>Name</key>
	<string>Garage Games</string>
	<key>Operators</key>
	<integer>0</integer>
	<key>ResultsPerPage</key>
	<integer>10</integer>
	<key>Start</key>
	<integer>0</integer>
	<key>Version</key>
	<real>1</real>
</dict>
</plist>

Hi there,

The first thing you want to change is the LinksStart and LinksEnd keywords. The string values you’ve defined are not unique enough to mark the area of the HTML where DEVONagent wants to look for links.

Try this instead (pseudocode, the value is everything between [' and]’)


LinksStart := [<td class="t" nowrap="1"><font size="-1">
                  Searched for]
LinksEnd := [<td valign="bottom" nowrap="1"><font size="-1">
                  Result&nbsp;Page:&nbsp;</font></td>]

And try again. I’m sure it will find results now.

I would also not use the Operators keyword. Since you are using Google as the search engine you can be sure it will support the default operators that DEVONagent uses. The one that you defined is very restrictive and could cause more data to be downloaded to DEVONagent and then it has to do more work to execute the operators locally. Why not let the server help out and save you some computing cycles?

Cheers!

Thanks for your help!

I’ve got this now:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>GarageGames.com search plugin</string>
	<key>EngineURL</key>
	<string>http://search.garagegames.com/search?restrict=&amp;ie=&amp;q=_agentQuery_&amp;site=GarageGames&amp;output=xml_no_dtd&amp;client=GarageGames&amp;btnG=Google+Search&amp;access=p&amp;btnG.y=0&amp;lr=&amp;btnG.x=0&amp;proxystylesheet=GarageGames&amp;oe=&amp;start=_agentOffset_</string>
	<key>Identifier</key>
	<string>edu.vt.cs.deimos.GarageGames</string>
	<key>Info</key>
	<string>GarageGames search engine (c) Lally Singh</string>
	<key>LinksEnd</key>
	<string>            &lt;td valign="bottom" nowrap="1"&gt;&lt;font size="-1"&gt;
                  Result&amp;nbsp;Page:&amp;nbsp;&lt;/font&gt;&lt;/td&gt;</string>
	<key>LinksStart</key>
	<string>&lt;td class="t" nowrap="1"&gt;&lt;font size="-1"&gt;
                  Searched for</string>
	<key>Name</key>
	<string>Garage Games</string>
	<key>ResultsPerPage</key>
	<integer>10</integer>
	<key>Start</key>
	<integer>0</integer>
	<key>Version</key>
	<real>1</real>
</dict>
</plist>

However, I’m still getting zero results. I type in a search string (such as ‘tnl’), and it says “Initializing…” and then immediately tells me ‘0 pages with 0 KB done’. Ethereal says that it didn’t send out a single packet. I tried emptying the cache, no help.

Thanks again for all your help!

EngineURL should be EngineUrl (see message logged by DEVONagent to system console) and Version should be a string. But this version should be more or less complete:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>GarageGames.com search plugin</string>
	<key>EngineUrl</key>
	<string>http://search.garagegames.com/search?restrict=&amp;ie=&amp;q=_agentQuery_&amp;site=GarageGames&amp;output=xml_no_dtd&amp;client=GarageGames&amp;btnG=Google+Search&amp;access=p&amp;btnG.y=0&amp;lr=&amp;btnG.x=0&amp;proxystylesheet=GarageGames&amp;oe=&amp;start=_agentOffset_</string>
	<key>Identifier</key>
	<string>edu.vt.cs.deimos.GarageGames</string>
	<key>Info</key>
	<string>GarageGames search engine (c) Lally Singh</string>
	<key>LinksEnd</key>
	<string>&lt;td valign="bottom" nowrap="1"&gt;&lt;font size="-1"&gt;</string>
	<key>LinksNotMatching</key>
	<string>*search.garagegames.com*</string>
	<key>LinksStart</key>
	<string>&lt;td class="t" nowrap="1"&gt;&lt;font size="-1"&gt;</string>
	<key>Name</key>
	<string>Garage Games</string>
	<key>OffsetPerPage</key>
	<string>10</string>
	<key>ResultsPerPage</key>
	<integer>10</integer>
	<key>Start</key>
	<integer>0</integer>
	<key>Version</key>
	<string>1.0</string>
</dict>
</plist>


Those two changes did the trick!