npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

pingbackclient

0.0.5 • Public • Published

PingBackClient

Send synchronized pingback requests, to ensure pingback requests are processed at a specific time by the server.

This can be useful if you want multiple wordpress servers to process a pingback request at exactly one moment..

Example

This example will ask 'the-wordpress.fr' to process N http requests to the url: 'https://the-target.com'

 
// build configuration object for synchronized requests
const config: SyncRequestConfig = PingBack.getRequestConfig({
    /** url that will be fetched by the wordpress */
    target: 'https://target.com',
 
    /** wordpress informations */
    source: {
        /** link to an article */
        article: 'http://the-wordpress.fr/2018-06-12/an-article/',
 
        /** host on which to contact the xml rpc gate (default xmlrpc file: `http://${xmlRpcHost}/xmlrpc.php`) */
        xmlRpcHost: 'the-wordpress.fr'
    }
});
 
// nb of requests to make
const N: number = 10;
 
(async () => {
    // build requests objects
    let requests: SyncRequests = new SyncRequests();
    for (let i = 0; i < N; ++ i)
        requests.addRequest(config);
 
    // start pingback requests
    await requests.start();
 
    // terminate pingback requests
    await requests.terminate();
})();

install

npm i pingbackclient

Downloadsweekly downloads

8

version

0.0.5

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability