Technorati Ping Utility Class
8/25/2007 5:55:59 PM
I woke up this morning to rain and gloom (can't go golfing) so I decided to channel my energy into creating a Technorati ping utility class for those of you that aren't using a blog engine that already includes this functionality. I made a post a long time ago about this but figured I would roll it into a .dll that I can throw into other projects. It's pretty simple and all I have left to do is finish up all the error-handling (i.e. try-catch). Other than that it's 100% functional and pretty painless to use. I should probably also mention that it is .NET 2.0.
using Technorati;
Ping ping = new Ping("http://www.willasrari.com", "Will Asrari");
PingResponse pingResponse = Ping.AttemptWithResponse(ping);
if (pingResponse.Successful)
{
// high-fives
}
else
Response.Write(pingResponse.Message);
You can also call Attempt : bool as well if you don't care about the response message that Technorati provides.
Ping ping = new Ping("http://www.willasrari.com", "Will Asrari");
bool successfulPing = Ping.Attempt(ping);
if (successfulPing)
{
// high-fives
}
The Technorati Ping API is pretty simple. You only need to provide two things: url and url title. That's it.
Easy. Maybe I'll even get an MVP to ask me how to add a reference as a result of posting this.
Notes
I ran into a couple of issues while testing this utility. Even if you get back a successful response that doesn't necessarily mean that your site will be re-indexed. Your ping could've been successful but if you constantly ping without any new updates Technorati will ignore your pings (at least that's how I see it). There were a couple of times that my ping response came back as false and the message was "Thanks for the ping". Could be me, could be Technorati. Hopefully it isn't me.
Download
Will Asrari Technorati Ping Utility (.NET 2.0)
I'll probably provide source code at a later time. I'm going to finish working on it here and there. If you're hip to Reflector why not give that a try.
C#,
XML
