Multiple EngineUrls depending on search term

How does one write a plugin for a site search where the EngineUrl changes form entirely depending on the word entered in the search field.

E.g. visit stackoverflow.com

Enter “UITableView” in the search field note, EngineUrl is of the form:
stackoverflow.com/search?q=agentQuery
with next url being stackoverflow.com/search?q=_agen … =relevance

Now enter “ruby” in the search field – note it is identified as a “tag” so it gets different treatment. EngineUrl is of the form:
stackoverflow.com/questions/tagged/agentQuery
with next url being stackoverflow.com/questions/tagg … entNumber_

Do I need to write two unique plugins or is there someway I can handle all this in a single plugin?

There is only a concept of a “next page” URL. In your case you’ll need to create two different plugins. But you can combine them in a search set.

Thanks Annard. Stack Overflow plugin(s) are @ http://github.com/statefullabs/devonagent-plugins