Microformats
Understanding
Webmention Protocol Summary
Junco support 21Sep2013
regex
Reply To - Comments
You're viewing old version number 38. - Current version
Add webmention client code to Junco
Dvlp to-dos (3oct2013)
- [X] same source post URL can be posted only once to the target.
- [X] create new get_blog_post subroutine check for target.
- [X] webmentions can only be posted when the blog post contains the blog_username tag.
- [X] add the webmention=no command to disable the option for a blog post.
- [X] currently, webmentions will remain unavailable for microblog posts.
- [X] look for the e-content microformat property on html5 section tag.
Microformats
using:
http://search.cpan.org/~gaas/HTML-Parser-3.71/lib/HTML/TokeParser.pm
<div class="h-entry">
article post
</div>
<article role="article" class="h-as-note h-entry hentry note-single">
<section class="e-content">
article text
</section>
</article>
<article class="entry h-entry entry-single flow wf">
<section class="e-content">
article text
</section>
</article>
<article class="h-entry">
<h1 class="p-name">Microformats are amazing</h1>
<p>Published by <a class="p-author h-card">W. Developer</a>
on <time class="dt-published" datetime="2013-06-13 12:00:00">13<sup>th</sup> June 2013</time>
<p class="p-summary">In which I extoll the virtues of using microformats.</p>
<div class="e-content">
<p>Blah blah blah</p>
</div>
</article>
http://adactio.com/journal/6495/
I’m using that to check the cURLed source for any responses that have been marked up using h-entry. That’s one of the microformats 2 vocabularies—a much simpler way of writing structured content with microformats. Aaron, Amber, and Barnaby all sent responses that were marked up with h-entry so now their responses appear in full.
http://microformats.org/wiki/microformats2
http://microformats.org/wiki/h-entry
Access these tags and links:
update: 21Sep2013 - focus on these links initially:
- http://indiewebcamp.com/webmention
- http://adactio.com/journal/6469
- http://adactio.com/journal/6495
- https://gist.github.com/adactio/6575229
- http://caseorganic.com/replies/2013/09/09/1/
Add to header.tmpl:
<meta name="author" content="Jeremy Keith" />
<link rel="webmention" href="http://adactio.com/webmention.php" />
old link list:
- http://adactio.com/journal/6495
- https://github.com/converspace/webmention
- https://github.com/aaronpk/webmention.io
- #webmention
- #indieweb
- IndieWebCamp principles for building the indie Web
- http://webmention.org
- http://indiewebcamp.com/webmention
- https://github.com/phpish/webmention
"The ability for one webpage to let another know the first has linked to the second is a vital indieweb building block.
The key mention technology for the indieweb is: webmention"
http://gist.github.com/adactio/6575229 - "The form I put at the end of every blog post I make so that you can ping my webmention endpoint with your response."
<form method="post" action="/webmention.php">
<p>Have you published a response to this?
<label for="webmention-source">Let me know the <abbr title="Uniform Resource Locator">URL</abbr></label>:
</p>
<input type="url" name="source" id="webmention-source">
<input type="hidden" name="target" value="http://adactio.com/journal/6495/">
<input type="submit" value="Ping!">
</form>
Sep 15, 2013 - Parsing webmentions
Understanding
I'm still trying to understand webmentions and pingbacks.
I guess that I viewed this more as a remote-commenting function.
- Blogger A creates a post
- Blogger B would like to "comment" on Blogger A's post, but A does not allow comments.
- Blogger B can create a post that is responding to A, but unless B contacts A through e-mail or some other means, A will be unaware of B's blog response.
- But if Blogger A supported some kind of remote commenting system, and maybe that could be webmention, then Blogger B could create a blog post and include the URL to Blogger A's post.
- at the bottom of Blogger A's post would be Blogger B's blog post response title, which would be a link to Blogger B's reply post.
- Blogger B can only create one blog post response for each blog post by A.
The above would work and display similar to my reply as a blog post function in my Kestrel code that was removed when I started over with the Junco codebase.
Maybe a remote comment procedure would send to the original blog post app:
- reply blog post URL
- reply blog post title
- reply blog post author name/username that links to Blogger B's home page
- reply blog post creation/published date (date sent to Blogger A)
- an optional brief description or intro to the blog post, limited to x-number words or characters (Blogger A's software could set the char or word limit or not display the description at all)
Make it a POST request from Blogger B to Blogger A, and encapsulate the above info in JSON.
Could still be abused by spammers and trolls, unless Blogger A establishes a white list of users permitted to create blog replies. Blogger B would have to seek permission from Blogger A to be on the whitelist.
Webmention Protocol Summary
From http://indiewebcamp.com/webmention
Assuming Aaron's blog supports receiving webmentions, and Barnaby's blog supports sending webmentions:
- User Aaron posts a blog post on his blog
- User Barnaby writes post on his blog that links to Aaron's post.
- After publishing the post (i.e. it has a URL), Barnaby's server notices this link as part of the publishing process
- Barnaby's server does webmention discovery on Aaron's post to find its webmention endpoint (if not found, process stops)
- Barnaby's server sends a webmention to Aaron's post's webmention endpoint with
source set to Barnaby's post's permalink
target set to Aaron's post's permalink. - Aaron's server receives the webmention
- Aaron's server verifies that target (after following redirects) in the webmention is a valid permalink on Aaron's blog (if not, processing stops)
- Aaron's server verifies that the source (when retrieved, after following redirects) in the webmention contains a hyperlink to the target (if not, processing stops)
Unmentioned but implied (and vaguely mentioned in the pingback spec):
- Aaron's server displays the information about Barnaby's post somewhere on Aaron's post.
Own Your Comments
Proposed by Aaron Parecki
This session is about IndieWeb Commenting and feedback systems.
What does it mean to post a comment in an indie web? As the author of a comment, you should own and control it, most likely you should post it on your own site. But we still want to have the benefits of centralized commenting systems like seeing a list of all comments left on a post, filtering spam comments, etc.
One way to handle comments is through the pingback or trackback protocols, both of which are widely implemented in many major blogging platforms. We can discuss the merits and drawbacks of each, and other possible solutions. A workshop session could involve implementing trackbacks/pingbacks on your own site, or implementing a new mechanism for using them.
Also see: backfeed
Junco support 21Sep2013
Should the remote webmention information be posted in the content table as a microblog post?
If so, what about author id info? Create a generic "Webmention" account at JotHut?
Would I need to add one or more columns to the content database table to support webmentions?
If the info was stored as a microblog post, then in theory, I could still click the "replies" link at the top of the site.
Since at the moment, I do not plan to allow others to create accounts at JotHut, the "replies" link at the top of the site is meaningless. I have been using the reply feature on my microblog posts to add additional information or notes. I did not expect to use the reply mechanism for my own microblog posts, but it's a handy tool for quick-hitting notes that should are associated in a common thread.
If I don't store webmentions in the content table, then I would need to add an additional link to the top of the site that would display the list of recent remote replies.
The webmention table may need to store:
- id
- target = URL for my post at Jot Hut
- source = remote URL for the response to my post
- date = when the response was submitted to Jot Hut (not the date that the remote response or webmention was created by another person)
- status = 'o' open for display
I should provide the ability to hide webmentions from displaying under my posts.
And I should add a blacklist of sites prohibited from creating a webmention.
The webmentions would not display by default under my posts at Jot Hut. I would treat this the same way that I do now with the built-in reply mechanism, which is to display a link, such as: webmentions: 8 that when clicked will show all the replies. Example:
http://jothut.com/cgi-bin/junco.pl/microblogpost/3904 - notes taken while watching the Browns-Dolphins game.
The above post displays something like this:
Miami, 2nd half, opening poss, 3rd and 11 own 16, pass inc. 3 and out. Punt. Ball downed at Clev 22. Good punter for Miami. #browns.
From JR's : micro blog
created on Sep 08, 2013 at 02:48:35 PM - # - replies: 95
reply
The "replies: 95" link must be clicked to display the replies for the post. That's different from a normal commenting system on a blog or message board, but webmentions is a different response mechanism.
With Jot Hut, I prefer to keep the display page for a blog or microblog focused on the content that I create. One additional click is not a hardship, in my opinion.
regex
http://www.perlmonks.org/?node_id=507660
Here is the regex to match the tag with attributes value.
m#<([^">]+(?:"[^"]+")*[^>]+)>#
another comment
m#
< ## start with <
( ## group start
[^">]+ ## text but Not match " and >
(?:"[^"]+")* ## if " found, match till end quote found. Its optional
[^>]+ ## text but Not match and >
) ## group end
> ## End with >
#
http://www.codinghorror.com/blog/2009/11/parsing-html-the-cthulhu-way.html
Reply To - Comments
http://indiewebcamp.com/comment
<div class="entry-content e-content" property="schema:text sioc:content">
<p>Testing, testing, <a href="http://eschnou.com/entry/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and--62-24908.html" rel="in-reply-to" class="u-in-reply-to">is this thing on?</a></p>
</div>
#junco - #juncotodo - #indieweb - #comments
From JR's : articles
1509 words - 10532 chars
- 8 min read
created on
updated on
- #
source
- versions
Related articles
In Progress - Add webmention client code to Junco - Oct 21, 2013
Syndicate JotHut.com posts to Twitter using the share button - Nov 01, 2013
Creating a Webmention blog reply post at JotHut - Oct 23, 2013
Webmention info to read again - Apr 02, 2014
Webmention.io and IndiAuth - Dec 18, 2014
more >>