Manual pingback script

If you've written a Web page that links to a page on a blog server and that blog server supports pingbacks, you may want to inform that server that you just linked to it. Some blog servers then automatically add a link back to your page.

As described in blog 1 on the CSS blog, such automatic back links can make the pages into a thread, much like posts on a mailing list or on Usenet.

If your own Web server supports pingbacks as well, it might already send pingbacks to all servers you link to automatically, but if it doesn't (like mine), you'll need to send the pingbacks by hand.

The linked pingback script can be used for that. It is a little command line program that must be run with two arguments: the URL of your own page and the URL of the page your page links to. (If your page links to several other pages, just call the program several times, once for each page you link to.)

For example:

pingback.sh \
  http://www.phonk.net/Gedachten/pingback \
  http://www.w3.org/blog/CSS/2007/05/30/blog_number_1

The program is written in Bash (thus it needs a Bash interpreter, such as is found on all Unix systems, including Mac OS X, and also in Cygwin for Windows). It also requires curl and nc (netcat) to be installed.

A similar (older) protocol to pingback is called “trackback.” My trackback script works in same way as the pingback script. Some blogging software is better at handling one than the other…

Bert Bos <bert at phonk.net>
Created: 27 June 2007