webmention-testpinger
v0.7.0
Published
A tool to ping your site with a variety of webmention markup
Downloads
24
Readme
WebMention Test Pinger
A tool to ping your site with a variety of WebMentions markup. Contains copies of a couple of real world examples of mentions that it enables you to ping locally to a development copy of your site.
Real world sites included
- AaronParecki.com by Aaron Parecki
- Adactio.com by Jeremy Keith
- Brid.gy by Ryan Barrett (Example code from here)
- notizBlog.org by Matthias Pfefferle
- Sandeep.io by Sandeep Shetty (A special like mention)
- Tantek.com by Tantek Çelik (A special RSVP mention)
- VoxPelli.com by me, Pelle Wessman (With an added <base> tag to resolve the avatar correctly)
- Your site? Send a pull request with a copy of your WebMention page in the templates directory with the mention target set to "http://example.com/webmention/target/placeholder"
Test suites included
- checkmention by KB Sriram, includes the two xss tests
Usage on CLI
First install from NPM:
npm install -g webmention-testpinger
Then run by doing:
webmention-testpinger --endpoint=http://example.com/endpoint --target=http://example.com/target
This tool will spin up a server on port 8080 and then ping the specified WebMentions hub with a URL to that server or each real world example which will return a copy of that example with a placeholder URL replaced with the requested mention target. After all pinged mentions has been fetched it will shut down the server and finish its execution.
Options
To list all available options, run:
webmention-testpinger --help
Usage in Node.js project
First add it from NPM:
npm install webmention-testpinger --save-dev
Then require it and set it up:
var WebMentionTemplates = require('webmention-testpinger').WebMentionTemplates;
var templateCollection = new WebMentionTemplates();
templateCollection.getTemplateNames().then(function (templateNames) {
// "templateNames" contains an array of the names of all available templates
});
templateCollection.getTemplate(templateName, templateTarget).then(function (template) {
// "template" contains the rendered HTML for the template with the name "templateName"
// and has its webmention targeted at the "templateTarget" target URL
});
Options
One can send an object into new WebMentionTemplates()
to define some options. The possible ones are:
- templatePath – an absolute path to a folder in which a bunch of templates can be found
Requirements for CLI
- Node.js (with npm)
- Local copy of the hub you want to ping