Home > Programming > Blog Trackback Pinger in C#.

Blog Trackback Pinger in C#.

December 5th, 2009 Jimmy Leave a comment Go to comments

This code snippet shows one way you can easily notify blog search engines that your blog has been updated. Using the WebClient class you can easily do this. This code is compatible with both Mono C# and Microsoft Visual Studio C#.NET.

using System.Net;
class myClass
{
function pingSite()
{
blogname=”GeekMoz”;
blogurl=”http://www.geekmoz.com”;
rssurl=”http://www.geekmoz.com/feed”;
url = “http://pingomatic.com/ping/?title=” + blogname + “&blogurl=” +
url + “&rssurl=” + feed + “&chk_weblogscom=on&chk_blogs=on&
chk_technorati=on&chk_feedburner=on&chk_syndic8=on&
chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&
chk_blogdigger=on&chk_blogstreet=on&chk_moreover=on&
chk_weblogalot=on&chk_icerocket=on&chk_newsisfree=on&
chk_topicexchange=on”;

WebClient wc = new WebClient();
string data = wc.DownloadString(url);
}
}

The data variable can be checked for any responses such as successes or errors. Below are some C# URL’s for other Blog Search Engines. PingOMatic pings most of them, but you could still ping them just in case. You could use the code to run once a day and sit in your tray bar too I suppose.

Technorati:
url = “http://www.technorati.com/ping/?url=” + url;

Google Blog Search:
url = “http://blogsearch.google.com/ping?url=” + url + “&hl=en”;

IceRocket:
url = “http://www.icerocket.com/c?p=ping&url=” + url ;

Categories: Programming Tags:
Digg: DIGG ME
  1. No comments yet.
  1. No trackbacks yet.