Pinging Technorati Programmatically
I accidentally came across the Technorati Ping Configurations page today. Never being one to say no to wasting time learning stuff, I created a quick-and-dirty console application to ping Technorati:
private static readonly string technorati = "http://rpc.technorati.com/rpc/ping";
public static string Ping(string name, string url)
{
HttpWebRequest request = HttpWebRequest.Create(technorati) as HttpWebRequest;
string pingData =
@"<?xml version=""1.0""?>
<methodCall>
<methodName>weblogUpdates.ping</methodName>
<params>
<param>
<value>{0}</value>
</param>
<param>
<value>{1}</value>
</param>
</params>
</methodCall>";
pingData = string.Format(pingData, name, url);
request.Method = "POST";
request.ContentType = "text/xml";
request.ContentLength = pingData.Length;
using (System.IO.StreamWriter writer = new System.IO.StreamWriter(request.GetRequestStream()))
{
writer.Write(pingData);
writer.Flush();
}
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()))
{
return reader.ReadToEnd();
}
}
}

1.
Vertygo on January 08, 2007 at 07:41 am
Very interesting !!! Thanks