|
Cookbook /
Bloge-LinkbackSummary: Automatically send and receive Pingbacks and Trackbacks
Version: 2009-08-12
Prerequisites: PmWiki 2.2.x, PHP with the cURL Library
Status: beta
Maintainer: Eemeli Aro
DescriptionPingback and Trackback are two different types of linkback methods, whereby one site can tell another that a link has been made between them. Bloge-Linkback allows PmWiki to automatically handle both types of messages both as a client and as a server. The recipe has two parts that may be used completely separately from each other. Bloge-Linkback is a part of Cookbook.Bloge, but may also be used as a standalone recipe. Installation
Both files may be included in common or per-page/group customization files independently of each other. LinkbackClientThe client part of the recipe is triggered when a page is edited and then published (drafts and 'Save and edit' are ignored), in which case the lines that have been changed in the edit are parsed for external links. In other words, internal links and links in unchanged blocks are ignored. For each link, the actual URL is determined (ie. intermap links are properly processed) and matched against some filter conditions. If it passes, the target is scanned for Pingback and Trackback server autodiscovery. If either is found, the corresponding protocol is used to tell that server that a link has been made. The actions of the client are logged on the page LinkbackServerThe server has two functions: first, it adds Pingback and/or Trackback autodiscovery strings to the page, and second, it handles any incoming link announcements. The autodiscovery may be disabled by setting Some sanity checks are made when a linkback request is received, such as verifying that the requesting site has the same IP address as the claimed source, that the source exists, and that the source actually contains a link to the target. Also, setting On a successful linkback reception the linkback is added to the page (:include Site.Linkbacks#{*$Group}--{*$Name}:)
on a page will result in an empty string if no linkbacks have been made and with the following markup if such do exist: [[#Cookbook--Bloge-Linkback]] !!! Linkbacks * http://example.com/blog/2009-08-09-new-blog-post (2009-08-09 13.43) * http://example.org/wiki/Group/InterestingPages (2009-08-13 00.28) Using NotesMarkup escaped using The Trackback protocol supports a few data fields that are not used by Bloge-Linkback. To add or set these in the client you'll need to modify the source at the commented lines of LinkbackPingLinks(). The Trackback autodiscovery As a whole this recipe has functionality very close to that of Cookbook.Pingback. The differences come meinly from handling Trackback as well as Pingback, and not requiring a whole slew of PEAR extensions. The only dependency the recipe has is for cURL; it would be possible to get the whole thing to work using a more common library, but to be honest I couldn't be bothered. To customize the format of For some reason the Release notes
See also
ContributorsComments
User notes? : If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |