How to Use ColdFusion to Ping the Ask, Google, MSN, and Yahoo Sitemap Services

ColdFusion PingSitemaps help web crawlers to do a better job of crawling your site. If your content is continously updated, then you should let the search engines know that your XML file of all your site links has been updated. To date, Ask, Google, MSN, and Yahoo support the Sitemap 0.90 protocol. Visit sitemaps.org for the sitemap XML format, if you haven’t already created one. There are also websites that will create a sitemap for you.

Here is a solution you can use in your ColdFusion applications which will alert the four major search engines that your sitemap has been refreshed.

The code is fairly easy. First, we wrap our code in a <cftry> with a <cfcatch> if something goes wrong. Then, we use the <cfhttp> tag to send a request to the sitemap ping service specified by the particular search engine. The "redirect" attribute is important because, by default, <cfhttp> will redirect to the URL specified in the tag. We choose "no" to allow for multiple pings in one process. After the ping is made to the service we set a variable for the header status code. 200 OK is a successful request and 404 Not Found means the page was not accessed. Once all of the selected pings have run, the use <cfmail> to email the results.
















Ask: #AskPingStatus#
Google: #GooglePingStatus#
MSN: #MSNPingStatus#
Yahoo: #YahooPingStatus#
#cfcatch#

This code can be run either when a sitemap is updated, or as a scheduled task. I prefer to ping the sitemap services when I create my feed.

Did you find this ColdFusion code useful? Let me know.


RSS feed | Trackback URI

6 Comments »

Comment by sho'fr
2007-12-03 10:19:33

ahh, very clever use of coldfusion. as much as the big 4 claim to listen to your robots.txt file, they have allot of room to improve.

your readers may appreciate a quick refresher on the basics of creating a proper sitemap.xml file: http://blog.shofr.com/2007/development/seo-101-sitemaps/

 
2007-12-05 19:31:11

have you the link for german language too? if yes - please post here.

Comment by Jason Bartholme
2007-12-06 00:11:29

Hello Suchmaschinenoptimierung,

I believe the URL to ping Google is as follows:

http://www.google.de/webmasters/sitemaps/ping?sitemap=
http://YOURDOMAIN/sitemap.xml

As for the others I don’t, know but I can ask around for you.

 
 
Comment by management
2007-12-26 03:18:15

thanks for the info this can be very useful.
is this needed for google if you use the webmaster tools?
Can this be saved as a php file and after updating my sitemap I can just run the file from the browser?
Thanks!

 
Comment by Scotty
2008-02-04 16:12:08

You could use crawlscore.com to generate the sitemaps on a regular basis.

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post

ss_blog_claim=85f01294d5e7bb5fef0d6e569c52d7ee