Discovering Blog Ping Services

curl, php, SEO

When driving traffic to a website, the continuous battle is the constant chopping and changing of your page and content in order to create the perfect SEO formula. I have always been interested how WordPress and Blogspot pages were able to receive traffic so quickly, and so much of it, without any kind of special optimizing of the page. Sure enough, Google has built a smart algorithm that will index and extract content from these blogs, but I couldn’t work out how search engines “knew” new content has been published on a Blog.

I have recently found out about “blog ping services” today, and spent some time reading up on these. Basically, a blog ping service will notify search engines and aggregators when there has been new content published on your page. Very smart! In addition to that, content is indexed very quickly and in many cases will filter through into blog aggregators such as Google blogs and Yahoo! blogs.

So, in PHP, how did I achieve this task? I started out with pingomatic. If you visit pingomatic’s homepage, you will see the different search engines that this blog ping delivers notifications to.

The next step was to integrate this into my code. Firstly, build your pingomatic URL, and keep it safe for later. Generally, the Pingomatic page will tell you to bookmark the page so that whenever you update your blog, you can visit that URL and Pingomatic’s harvester will deliver a message to all of the search engines.

Of course the most important job of a web developer is to strive for optimization and automation. We’re letting Pingomatic do the optimization for us, so now let’s focus on the automation. In my example below, this is a simple way to use PHP:

$webservice = "http://pingomatic.com/ping/?title=yourblog&blogurl=http%3A%2F%2Fwww.yourblog.com&rssurl=http%3A%2F%2Fwww.yourblog.com%2Ffootball_news.xml&chk_weblogscom=on&chk_blogs=on&chk_feedburner=on&chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_weblogalot=on&chk_newsisfree=on&chk_topicexchange=on&chk_google=on&chk_tailrank=on&chk_postrank=on&chk_skygrid=on&chk_collecta=on&chk_superfeedr=on&chk_audioweblogs=on&chk_rubhub=on&chk_a2b=on&chk_blogshares=on";
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_URL, $webservice);
 curl_setopt($ch, CURLOPT_HTTPHEADER,
 array('Content-type: text/xml'
 , 'Content-length: '.strlen($request)
 ,'User-Agent: Mozilla/5.0 (Windows; U;
 Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729' ));
 curl_setopt($ch, CURLOPT_POST, true);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
 $result = curl_exec($ch);

Quite simply, if you embed this code into your PHP code, a curl request will be sent to Pingomatic notifying their harvester that there is new content on your page. Done – enjoy the new traffic!