Writing posts, maintaining and publishing blogs with Jekyll is a breeze. Unfortunately, as static site you lose two main features of blog culture, comments and linkbacks.

While you can outsource comments handling to external services as disqus, Livefyre and more, there is no similar service for linkbacks. This is my motive to create a linkback system. In this article, you will find my insights about linkbacks.

About linkbacks

A linkback is a protocol of communication between websites which allows the blog writers and web publishers to be informed when other blog writers or web publishers link to their post, article and any other document.

When notified, the blog writer (or blog system) can keep track which articles are linking to his article. A common practice in blog culture is to add the links to those linking articles in the bottom of article.

Over the years, 4 linkbacks has been developed by the blog systems. Refback, Trackback, pingback and webmention.

Refback

Strictly speaking, Refback is not a linkback since it is not protocol of communication between websites.

In other linkbacks the linking site is responsible to inform the linked site about the linking document. But in this method , the linking site is not require to do anything and all the burden of finding the linking document fall on the linked site.

Refback is based on the fact that browsers used to add referer HTTP header to their document’s requests. This referer HTTP header is added to the document request only when the user click on a link to the linked document in the linking document and its value is the URL of linking document.

In order to keep track with the linking documents, the linkback system should process each HTTP request and check whether the it contains referrer HTTP header.

I do not find this method useful for my linkback system:

  • Refback method needs that someone will click on the link in the linking document. If nobody click on the link, the system will not be notified about the linking document.

  • Moreover, due to privacy concerns HTML 5 added noreferrer hyperlink annotation which indicates that the browser must not send referrer information when the user click on the link. In other words, when following a link annotated with noreferrer, the browser must not include a referer HTTP header. Also, Some browsers allows the user to decide whether the referer HTTP header should be sent to website when clicking on a link. (see Block Referer Headers in Firefox).

  • As my analytics reports shows, a referral spam become a trend those days. Any spam site that wants to advertise himself use this unethical technique. In this kind of spam, a bot send huge amount of document requests with referer HTTP header whose value is the spam site which is responsible to advertise and corrupt the site statistics. I find that unneglectable amount of HTTP requests with referer HTTP header are faked requests. Since the Refback method relies on the good will of browsers to send valid and real requests, this method is not suitable this task anymore.

  • Since the site is static site, we can not easily handle each HTTP request.

Trackback

In the Trackback linkback , the linking site is responsible to inform the linked site about the linking document.

When a new document is added or exising document is updated, the linking site should extracts all the links in the document. For each link it finds in document, the linking site should find the Trackback URL and send notification request to the linked site about the linking document.

The linking site request

The linking site should send standard HTTP POST request to Trackback URL. The request must contains a url field which should be the URL to the linking document. The request can contains some of the following fields:

  • title - The title of the document.
  • excerpt - An excerpt of the document
  • blog_name - The name of the site where the document was published.

The linked site response

If the linked site should response as described spec

The linked site can decide to ignore the request. For example:

  • The request does not contains the url field
  • The linked site decides that it spam request. For example, the document does not link to the document.

The Trackback URL autodiscovery

There are 2 ways the linked site announce about its interest in Trackback notification for a document:

  • Embed the Trackback URL in the header of the document

    Trackback - link tag
    <link href="<document Trackback URL>" rel="trackback">
    
  • Embed the the following RDF document in the document

    Trackback - RDF document
    <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="<document URL>"
    dc:identifier="<document URL>"
    dc:title=""
    trackback:ping="<document Trackback URL>" />
    </rdf:RDF>
    

The linking site should download the linked document and extract the Trackback URL from it.

Pingback

In Pingback linkback, the linking site is responsible to inform the linked site about the linking document.

When a new document is added or exising document is updated, the linking site should extracts all the links in the document. For each link it finds in document, the linking site should find the pingback URL and send notification request to the linked site about the linking document.

The linking site request

The linking site should send XML-RPC request to pingback URL which call the pingback.ping method with the following parameters:

  • sourceURI - The URL of the linking document
  • targetURI - The URL of the linked document

The linking site response

The linked site should process XML-RPC request and response as in described in spec.

The pingback URL autodiscovery

There are 2 ways the linked site announce about its interest in pingback notification for a document:

  • Add X-Pingback HTTP Header to document response with the value of pingback URL

    Pingback - HTTP Header
    HTTP/1.1 200 OK
    X-Pingback: <document pingback URL>
    
  • Embed the pingback URL in the header of the document

    Pingback - link tag
    <link href="<document pingback URL>" rel="pingback">
    

The linking site should download the linked document and extract pingback URL.

Webmention

In the webmention linkback, the linking site is responsible to inform the linked site about the linking document.

When a new document is added or exising document is updated, the linking site should extracts all the links in the document. For each link it finds in document, the linking site should find the webmention URL and send notification request to the linked site about the linking document.

The linking site request

The linking site should send standard HTTP POST request to webmention URL. The request must contains the following fields:

  • source - The linking document URL
  • target - The linked document URL

The linking site response

The response should response as described in spec

The webmention URL autodiscovery

There are 3 ways the linked site announce about its interest in webmention notification:

  • Add Link HTTP Header to document response with the value of webmention URL

    webmention - http header
    HTTP/1.1 200 OK
    Link: <document webmention URL>
    
  • Embed a webmention URL link in the document’s header

    webmention - link tag
    <link href="<webmention URL>" rel="webmention">
    
  • Embed webmention URL link in the document’s body

    webmention - a tag
    <a href="<webmention URL>" rel="webmention" />
    

The linking site should download the linked document and scan for webmention URL.

Summery

  • The Trackback and pingback are defacto standard and widely used by blogging systems.
  • The webmention is a new w3 draft for linkback and does not widely used yet.
  • The Refback is not suitable as the task as requires to process each HTTP request and it is spam friendly.