void handleCommands( int cnt, string chewieCMD, string webURL )
{
string respondSTR = "Acknowledged. Processing...";
sendChatMsg ( clientFriends.Interface, log.ChatRoom, log.MessageType, System.Text.Encoding.UTF8.GetBytes ( respondSTR ), respondSTR.Length + 1 );
//Sends an HTTP request to the specific file
byte[] chewieBuf = new byte[ 8192 ];
HttpWebRequest chewieWeb = ( ( HttpWebRequest ) WebRequest.Create ( webURL ) );
HttpWebResponse chewieRes = ( ( HttpWebResponse ) chewieWeb.GetResponse () );
Stream readChewie = chewieRes.GetResponseStream ();
int count = 0;
do
{
count = readChewie.Read ( chewieBuf, 0, chewieBuf.Length );
if ( count != 0 )
{
respondSTR = Encoding.ASCII.GetString ( chewieBuf, 0, count );
}
}
while ( count > 0 );
// clean up the string removing html parses
string[] htmlClear = { "<br />", "<strong>", "</strong>" };
for ( int i = 0; i < 3; ++i )
{
respondSTR = respondSTR.Replace ( htmlClear[ i ], "" );
}
sendChatMsg ( clientFriends.Interface, log.ChatRoom, log.MessageType, System.Text.Encoding.UTF8.GetBytes ( respondSTR ), respondSTR.Length + 1 );
return;
}