Skip to content

voxpelli/node-webmention-testpinger

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

WebMention Test Pinger

npm version npm downloads Module type: CJS Follow @voxpelli@mastodon.social

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

Test suites included

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

About

A tool to ping your site with a variety of real world WebMentions

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •