WebMention Client
JavaScript Vim script
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
.vimrc
LICENCE.md
README.md
index.js
package.json

README.md

Webmention Client

Travis CI Test Status

A simple client to ping a WebMention service.

Usage

var webmention = require('webmention-client');
var source = 'http://example.org/blog/my-latest-blog-post';
var target = 'http://example.com/blog/interesting-blog-post-i-want-to-link-to';

function webmentionComplete(err, response) {
  if (err) {
    // Handle error
    console.log(err, response);
  }
  else {
    // woot
    console.log(response);
  }
}

webmention(source, target, webmentionComplete);

API

webmention(sourceUrl, targetUrl, callback);

The sourceUrl is your URL, a blog post or article, that contains a link to the targetUrl at another location. The callback parameter is a callback function that is called:

callback(err, result);

The err parameter is any potential error encountered during the HTTP request.

The result parameter is an object containing a success boolean and a response object. If the response is JSON, this will be available as the response object; if the response is blank or non-JSON, it will be available as response.raw instead. For further information, see the WebMention specification.