pingbacks for node.js
It protects against spam, has no dependencies, and can be used right out of the box. Connect/Express middleware is included.
What you see above is merely the abstracted interface of the bundled middleware. See example.js/test.js for more in-depth and lower-level examples.
// ping a target - err will be a fault code if presentPingback;// scan an html string for links to pingvar text = 'a link here: <a href="">a post</a>';Pingback;
Again, see example.js/test.js for more examples and explanation.
PingbackMETHOD_NOT_FOUND = -32601;PingbackGENERAL_ERROR = 0;PingbackSOURCE_DOES_NOT_EXIST = 16;PingbackNO_LINK_TO_TARGET = 17;PingbackTARGET_DOES_NOT_EXIST = 32;PingbackTARGET_CANNOT_BE_USED = 33;PingbackALREADY_REGISTERED = 48;PingbackACCESS_DENIED = 49;
source: a parsed url object of the source
target: a parsed url object of the target
excerpt: an excerpt from the source's page
title: the title of the source page
ping: An optional event to validate and handle errors/faults. If bound, this will be triggered as the first event and passed a
nextcallback, which can be passed a fault code to trigger a fault response, otherwise it will continue handling the pingback. Arguments:
fault: Emitted when a fault occurs. Passed the fault code and string. Arguments:
error: Emitted for non-fault related errors. Calls the next middleware layer in the bundled connect/express middleware function. Arguments:
end: Emitted if no
pinglisteners have been bound, and after a pingback has been received and verified. Arguments:
nexthas the same effect as the callback passed for
success: Emitted if a
pinglistener was bound, and after the pingback has been received and handled. Arguments:
(c) Copyright 2011, Christopher Jeffrey (MIT License). See LICENSE for more info.