Clone wiki

BibSonomy / development / modules / pingback / Pingback


What is pingback?

The best definition of pingback is given in it's specification:

Pingback is a method for web authors to request notification when somebody links to one of their documents. Typically, web publishing software will automatically inform the relevant parties on behalf of the user, allowing for the possibility of automatically creating links to referring documents.

How does pingback work?

At first pingback actions are separated into two parts:

The pingback client

Pingback clients send notifications to document owners, after their documents has been linked in the clients system.

For this service the clients system has to check wether the document contains an external link and is a pingback enabled resource (e.g. may a user don't want to use pingback or the clients service has implemented a privacy system). After a link was found the pingback client sends a request to get the referenced resource and checks the result for at least one of two criteria with the autodiscovery algorithm.

If the referenced resource is pingback-enabled, one of the current criteria must fit:

  1. The response header contains a X-Pingback field with the address of the pingback server; or
  2. The response contains a <link> element with the attribute rel="pingback" and href="server address".

If none of those points matches, the referenced resource should not be pingback-enabled.

For this process of checking for those criteria a scheme is defined by the specification, named the Autodiscovery algorithm.

If such a link was found, the client knows the servers ip adress. Now an XML-RPC request is sent to the server. In the body of this rquest the pingback referer is specified.

Further detailed information about the pingback client process can be found in the pingback specification.

The pingback server

The pingback server must accept XML-RPC calls and must, if it conforms to the pingback specification return one of the given result codes.

For further information about pingback servers you can use the references.

Pingbacks in BibSonomy

BibSonomy provides pingbacks for public posts.

When a resource gets changed or is created, the pingback will be send from the #EditPostController by the #ThreadedPingback implementation in bibsonomy-pingback.

The threaded pingback implementation is a #Thread which supervises a queue, to which posts to pingback are added.

  • This queue is cleaned by a cronjob in a fixed interval.

When the queue is polled, the corresponding post is checked wether to be a publication or a bookmark post.

  • If it is a bookmark post, the main bookmark URL will be used as pingback address.
  • In case of a BibTeX post, the URL field and the misc with entry "ee" are checked for valid URLs and in case of those are set, they are used for pingback calls.

After those URLs were found, a pingback XML-RPC request is send by the #ApachePingbackClient, implemented by Elwyn Malethan which uses the Apache XMLRpc client.

The result of the pingback gets logged with debug level.

be careful

  • only pingback for public posts!
  • at the beginning: only for bookmarks
  • ignore spammers
  • do it in the background (e.g., use a thread to do it)
  • what happens, if the user edits the post? Is it a problem, if the same server gets pingbacked twice from the same target? Please check the protocol!
  • content negotiation (e.g., linked data) needs to be done on all requests. be strict: only when xml or rdf+xml is requested exclusively, send the corresponding redirect. otherwise return HTML always
  • ensure to only download a part of the document (first 100kb) - we should do this for scrapers, titles/keywords, etc., too. What does currently happen, when someone tags a radio stream?