<p>Webmention.io is a hosted service created to easily receive webmentions on any web page. </p>
<p> You might also be interested in reading about this projecton the IndieWeb wiki. </p>
<p> Use it on your site </p>
<p> Once you have signed up, add the following tags to your HTML, replacing “username” with the username you got when you signed up: </p>
<p> The system will begin collecting webmentions and pingbacks on your behalf. Of course you can leave off the pingback endpoint if you’d like. </p>
<p> Note that the “username” here will most likely be your domain. For instance, if your domain is https://aaronparecki.com/, then your username will be aaronparecki.com. </p>
<p> Forward pingbacks to webmentions </p>
<p> If you want to accept pingbacks on your website but don’t want to deal with the hassle of XMLRPC, you can use this service to forward pingbacks as webmentions to your server. You don’t need an account for this to work. </p>
<p> For further details and an example, please refer to the README. </p>
<p> Display a mention counter </p>
<p> You can use the API from Javascript to display a mention count of one or more URLs. </p>
<p> Getting the data manually </p>
<p> To retrieve the data manually (via Fetch API, jQuery, raw XHR, etc.), you can make a request like the following. Webmention.io sets Access-Control-Allow-Origin: * in response headers, so you can query from a browser as well as from a server. </p>
<p> fetch(“https://webmention.io/api/count?target=https://example.com/page/100”)<br />
.then(response = > response.json())<br />
.then(responseJson = > console.log(responseJson)); </p>
<p> This will return a list of total mentions of the URL as well as grouped by type. </p>
<p> {<br />
“count”: 6,<br />
“type”: {<br />
“bookmark”: 1,<br />
“mention”: 2,<br />
“rsvp-maybe”: 1,<br />
“rsvp-no”: 1,<br />
“rsvp-yes”: 1<br />
}<br />
} </p>
<p> Displaying counts automatically </p>
<p> You can include some simple markup and a Javascript file to automatically display the mention counter for one or more URLs on a page. </p>
<p> First, choose an element that will be used to display the counter. Add the attribute data-webmention-count to it, as well as data-url=”” with the full URL of the page you would like to count. This might look something like the following: </p>
<p> mentions </p>
<p> Then, add the following script tag to your page after you’ve included jQuery: </p>
<p> Show all mentions </p>
<p> You can also use the API to show all mentions of a URL. As with the count request, this will work from a browser or you can use the API directly from a server. </p>
<p> fetch(“https://webmention.io/api/mentions.jf2?target=https://example.com/page/100”)<br />
.then(response = > response.json())<br />
.then(responseJson = > console.log(responseJson); </p>
<p> Which will return data in this format: </p>
<p> {<br />
“type”: “feed”,<br />
“name”: “Webmentions”,<br />
“children”: [<br />
{<br />
“type”: “entry”,<br />
“author”: {<br />
“type”: “card”,<br />
“name”: “Tantek Çelik”,<br />
“url”: “http://tantek.com/”,<br />
“photo”: “http://tantek.com/logo.jpg”<br />
},<br />
“url”: “http://tantek.com/2013/112/t2/milestone-show-indieweb-comments-h-entry-pingback”,<br />
“published”: “2013-04-22T15:03:00-07:00”,<br />
“wm-received”: “2013-04-25T17:09:33-07:00”,<br />
“wm-id”: 900,<br />
“content”: {<br />
“text”: “Another milestone: @eschnou automatically shows #indieweb comments with h-entry sent via pingback http://eschnou.com/entry/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and–62-24908.html”,<br />
“html”: “Another milestone: @eschnou automatically shows #indieweb comments with h-entry sent via pingback http://eschnou.com/entry/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and–62-24908.html”<br />
}<br />
“mention-of”: “https://indieweb.org/”,<br />
“wm-property”: “mention-of”,<br />
“wm-private”: false<br />
}<br />
]<br />
} </p>
<p>Note: Changes to the Full-Text RSS free service</p>