Add plugin path, separate search plugins
[WebThing.git] / searchplugins / GoogleSearch.cs
similarity index 57%
rename from plugins/GoogleSearch.cs
rename to searchplugins/GoogleSearch.cs
index 7b1b542..1d345cb 100644 (file)
@@ -1,10 +1,10 @@
 using System;
-using bytex64.WebThing;
+using System.Web;
 using System.Text.RegularExpressions;
+using bytex64.WebThing;
 
 public class GoogleSearch : WebThingPlugin, ISearchPlugin {
     public string SearchTransform(string search) {
-        string[] words = Regex.Split(search, @"\s+");
-        return String.Format("http://google.com/search?q={0}", String.Join("%20", words));
+        return String.Format("http://google.com/search?q={0}", HttpUtility.UrlEncode(search));
     }
 }