A framework for peer-to-peer communication and notifications between web sites.
What is TrackBack?
TrackBack is a framework for peer-to-peer communication and notifications between web sites that was created at Six Apart in 2002. Since then support for Trackback has been included in TypePad, Movable Type, WordPress, and Typo. The central idea behind TrackBack is the idea of a TrackBack ping, a request saying, essentially, "resource A is related/linked to resource B." This is useful for things like notifying a blogger that you've linked to one of their posts from your own.
Using TrackBack, sites can communicate about related resources. For example, if Weblogger A wishes to notify Weblogger B that he has written something interesting/related/shocking, A sends a TrackBack ping to B. This accomplishes two things:
- Weblogger B can automatically list all sites that have referenced a particular post on his site, allowing visitors to his site to read all related posts around the web, including Weblogger A's.
- The ping provides a firm, explicit link between his entry and yours, as opposed to an implicit link (like a referrer log) that depends upon outside action (someone clicking on the link).
How do I send a TrackBack?
TrackBack uses a REST model, where requests are made through standard HTTP calls. To send a TrackBack ping, the client makes a standard HTTP request to the server, and receives a response in a simple XML format (see below for more details).
In the TrackBack system, the URL that receives TrackBack pings is the TrackBack Ping URL. A typical TrackBack Ping URL looks like http://www.example.com/trackback/5, where
5 is the TrackBack ID. Server implementations can use whatever format makes sense for the TrackBack Ping URL; client implementations should not depend on a particular format.
To send a ping, the client sends an HTTP POST request to the TrackBack Ping URL. The client MUST send a Content-Type HTTP header, with the content type set to
application/x-www-form-urlencoded. The client SHOULD include the character encoding of the content being sent (title, excerpt, and weblog name) in the charset attribute of the Content-Type header.
For example, a ping request might look like:
POST http://www.example.com/trackback/5 Content-Type: application/x-www-form-urlencoded; charset=utf-8 title=Foo+Bar&url=http://www.bar.com/&excerpt=My+Excerpt&blog_name=Foo
The possible parameters in the request content are the following:
The title of the entry.
An excerpt of the entry.
The permalink for the entry. Like any permalink, this should point as closely as possible to the actual entry on the HTML page, as it will be used when linking to the entry in question.
Required. If a client neglects to send a url, the server MUST respond with an error message.
The name of the weblog to which the entry was posted.
All of the fields provided MUST be in the character encoding specified in charset.
There are no length restrictions on the above fields inherent in the TrackBack protocol, but server implementations are free to crop or ignore any of the above fields.
In the event of a successful ping, the server MUST return a response in the following format:
<?xml version="1.0" encoding="utf-8"?> <response> <error>0</error> </response>
In the event of an unsuccessful ping, the server MUST return an HTTP response in the following format:
<?xml version="1.0" encoding="utf-8"?> <response> <error>1</error> <message>The error message</message> </response>
Auto-Discovery of TrackBack Ping URLs
TrackBack clients need a method of determining the TrackBack Ping URL for a particular URL or weblog entry. Server implementations should include embedded RDF in the pages they produce; the RDF represents metadata about an entry, allowing clients to auto-discover the TrackBack Ping URL.
Sample RDF looks like this:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> <rdf:Description rdf:about="http://www.foo.com/archive.html#foo" dc:identifier="http://www.foo.com/archive.html#foo" dc:title="Foo Bar" trackback:ping="http://www.foo.com/tb.cgi/5" /> </rdf:RDF>
Note: because current validators choke on RDF embedded in XHTML, if you want your pages to validate you may wish to enclose the above RDF in HTML comments:
<!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" ... </rdf:RDF> -->
This is not a perfect solution, but it works as a temporary fix.
The dc: elements are standard Dublin Core elements; the trackback:ping element comes from the TrackBack Module for RSS 1.0/2.0 at http://madskills.com/public/xml/rss/module/trackback/.
Given a URL my_url, clients should follow these steps:
- Send an HTTP GET request to retrieve the contents of the page at my_url.
- Scan the page contents for embedded RDF. Pages can contain multiple instances of embedded RDF--clients should pick the block whose dc:identifier matches my_url.
- Extract the trackback:ping value from the block of RDF. This is the TrackBack Ping URL.
Once the client has determined the TrackBack Ping URL, it can send a TrackBack ping.
- Application Type: Protocol
- Version: 1.2
- Released: August 2004
- Authors: Six Apart and Paul Prescod