rendered paste bodyelse if (e.Data.Message.StartsWith("!google"))
{
Google.GoogleSearchService s = new Google.GoogleSearchService();
try
{
Google.GoogleSearchResult r = s.doGoogleSearch(key, e.Data.Message.Substring(7), 0, 1, false, "", false, "", "", "");
string message = r.resultElements[0].title + " // " + r.resultElements[0].snippet;
string pattern = @"<(.|\n)*?>";
string stripped = Regex.Replace(message, pattern, string.Empty) + " <END OF GOOGLE>";
irc.SendMessage(SendType.Message, e.Data.Channel, stripped);
OutputLine("<" + sIRCBot.Properties.Settings.Default.botnick + "> " + stripped + "\r\n");
}
catch (System.Web.Services.Protocols.SoapException ex)
{
OutputLine(ex.Message);
}
}