Testing, testing,
h1. In Progress - Add webmention client code to Junco #inprogress Good example of either an Indie Web comment/reply or WebMention: http://aaronparecki.com/notes/2013/10/01/1/ http://snarfed.org/2013-10-02_comment-time-vs-money http://indiewebcamp.com/p3k https://github.com/indieweb/php-mf2 q. generic microformats-2 parser. It doesn’t have a hard-coded list of all the different microformats, just a set of procedures to handle different property types (e.g. p- for plaintext, u- for URL, etc). This allows for a very small and maintainable parser. q.. https://github.com/indieweb/mention-client-php q. Client library for sending webmention and pingback notifications. q.. https://github.com/converspace/webmention/issues/9 http://waterpigs.co.uk/notes?tagged=webmention http://waterpigs.co.uk/notes?tagged=reply http://microformats.org/wiki/h-entry http://indiewebcamp.com/comments-presentation#How_to_markup q. I publish microformats2 with classic mf fallback. Also consume lots of microformats data and built some tools to help others do the same: q.. http://github.com/indieweb/php-mf2 http://github.com/barnabywalters/php-mf-cleaner h2. Dvlp to-dos (3oct2013) * if webmention posted manually with the form, then return to user as happens now by displaying the page of replies. * if webmention posted programmatically, then return status codes. * "If the WebMention request was successful, the server MUST reply with an HTTP 202 Accepted" - http://webmention.org ** return JSON responses: *** "result": "WebMention was successful" *** "error": "no_link_found", *** "error_description": "The source URI does not contain a link to the target URI" * [X] "WebMention receivers SHOULD moderate WebMentions, and if a link is displayed back to the source, SHOULD link to source with *rel="nofollow"* to prevent spam." - http://webmention.org * investigate "indieweb comments":http://jothut.com/cgi-bin/junco.pl/blogpost/4135/Add-webmention-client-code-to-Junco#Reply-To---Comments ** why comments and webmentions? * [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. h2. Microformats using: http://search.cpan.org/~gaas/HTML-Parser-3.71/lib/HTML/TokeParser.pm https://eschnou.com/entry/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and--62-24908.html To get a webmention (source) reply post to appear at the target website, wrap the source post with an h-entry microformat code.
Published by W. Developer on
In which I extoll the virtues of using microformats.
Blah blah blah
Testing, testing,
class="u-in-reply-to"
on the target URL when it's included in my source (reply) post.
When a microblog (note) or blog post (article) is created in Junco, the app would search for class="u-in-reply-to"
within anchor tags, which would be targets. If found, then Junco would do a "get" on that target URL, read through the HTML, and search meta or link tags for a webmention URL program.
If the target has a webmention program, then Junco would send a POST request to that target's webmention program. The POST params would include URLs for target (the post that I'm replying to) and source (my reply post).
Once the POST request has been made, the target webmention app would return a status code, so that Junco can determine if success or failure or something else. Doesn't matter too much, since the source post still gets posted within the Junco app.
The target code would process the Junco post request, and add my source (reply) post to the thread or comment section of the target post. And if my source post contained h-entry and e-content info, then it's possible that some or all of my post would appear in the target's comment section.
A lot depends upon how the target app processes a webmention. Maybe after the Junco post request, and the target app has verified my source post, then my source post would go into a moderation queue and would not appear immediately in the comments section of the target page.
The target app may only display the source URL in the target's comment section and ignore the source's h-entry info.
The target may only display a snippet of the source's h-entry info, which is what I'm doing within the Junco app when the Junco app is receiving a webmention POST request (the Junco app is the target.)
If the target system does not supported automated webmentions (the target does not contain the webmentioni app in the meta or link tags), then maybe the target page contains the HTML form to allow a user to submit manually the source URL, which is what I'm doing now within Junco as of Oct 3, 2013.
Plus maybe the source software does not support auotmated webmentions. The source system may not scan its own source posts for links with the u-in-reply-to in order to send a POST request to the target. This is the current status for Junco as of Oct 3, 2013.
I'd like to automate Junco to send and receive webmention POST requests.
And I want to continue to supply the HTML form for manually submitting a webmention to a post within Junco.
If Junco was automated to make webmentions to the target, then the source post would include the target's URL, of course. For blog source posts, it would be easy to add the "in-reply-to" to the target's URL. For microblog source posts, I would need to add a new feature:
bq. in-reply-to:http://jothut.com/cgi-bin/d16augjunco.pl/blogpost/19
The Junco code would convert the URL to a link with the in-reply-to for the formatted markup. The link would be clickable when the displayed in Junco. And then Junco would automate the webmention POST to the target per above.
To keep it simple, I could also use the above proposed feature in blog posts too, but if I did not want to display the entire URL but only some link text, then the anchor tag or the Textile or Markdown anchor markup would contain the class="u-in-reply-to"
that I would add manually.
h2. Indieweb Comments How-To
From: http://indiewebcamp.com/comment
*How To*
Make a comment
How to publish an indieweb comment replying to an original post
Write a post (note/article/comment) on your own site
Link to the original with rel="in-reply-to"
If you are using the h-entry microformat to mark up your comment (you should), add class="u-in-reply-to" to the link as well
Send a pingback/webmention from your server to the original's server
Ideally your server/software should automatically do the (3)
pingback/webmention for all links in your post.
h2. Twitter
Some explanation of how this might all work:
https://github.com/barnabywalters/IndieWeb-Reply-Browser-Extension
https://github.com/barnabywalters/own-your-comments
http://indiewebcamp.com/Twitter
q.
In short, you have to use Twitter's snowflake API to POSSE posts to Twitter.
q..
http://indiewebcamp.com/POSSE
http://waterpigs.co.uk/notes/4SFEn4/
q.
Have you come across indiewebcamp.com at all, especially the work we’re doing on cross-site replying, webmentions and reply-contexts? E.G. this post is a reply on my own site to one of your tweets :)
q..
http://indiewebcamp.com/reply same as http://indiewebcamp.com/comment - whew, that's good.
http://indiewebcamp.com/webmention
http://indiewebcamp.com/reply-context
http://trailed.io/about
h2. Curl testing
From the command prompt
http://indiewebcamp.com/webmention#How_to_Test_Webmentions
send the webmention:
curl -i -d "source=$your_url&target=$target_url" $targets_webmention_endpoint
Junco example:
curl -i -d "source=http://jothut.com/cgi-bin/app.pl/microblogpost/122&target=http://jothut.com/cgi-bin/app.pl/blogpost/19" http://jothut.com/cgi-bin/app.pl/webmention
Since the webmention was already posted, running the curl again returns:
code.HTTP/1.1 404 Bad Request
Date: Fri, 04 Oct 2013 17:51:28 GMT
Server: Apache
Transfer-Encoding: chunked
Content-Type: application/json
{
"error": "already_registered",
"error_description": "The specified WebMention has already been registered."
}
code..
h2. Junco code automating webmention post
When creating/updating a post in Junco, the app searches for:
@rel="in-reply-to" class="u-in-reply-to"@
within the anchor tag, and then grabs the target URL within that anchor tag, searched for the webmention endpoint within the page located at the target URL, and then automates a post.
The Junco app would already know the source URL after a create/update of a post.
Command prompt script.
code.#!/usr/bin/perl -wT
use strict;
use warnings;
$|++;
use lib '/home/Junco/lib';
use MIME::Base64;
use REST::Client;
# set set up some defaults:
my $domain = 'jothut.com';
my $function = 'webmention';
my $prog = 'app.pl';
my $headers = {
'Content-type' => 'application/x-www-form-urlencoded'
};
# set up a REST session
my $rest = REST::Client->new( {
host => "http://$domain/cgi-bin/$prog",
} );
# then we have to url encode the params that we want in the body
my $pdata = {
'source' => 'http://jothut.com/cgi-bin/app.pl/microblogpost/143',
'target' => 'http://jothut.com/cgi-bin/app.pl/blogpost/19/03Oct2013/Webmention-Test-post---TARGET---1oct2013'
};
my $params = $rest->buildQuery( $pdata );
# but buildQuery() prepends a '?' so we strip that out
$params =~ s/\?//;
# then send the request:
# POST requests have 3 args: URL, BODY, HEADERS
$rest->POST( "/$function" , $params , $headers );
print $rest->responseContent() . "\n";
code..
h2. P3k Ideas
http://indiewebcamp.com/p3k
q.
Comment / Mention Updates
need to visually separate mentions from replies on my individual notes. http://aaronparecki.com/replies/2013/06/25/1/indiewebcamp See http://www.sandeep.io/84 for design inspiration
q..
http://www.sandeep.io/84
* comments
* likes
* reposts
* mentions
h2. Indie Web Replies
Example
http://aaronparecki.com/replies/2013/05/21/2/
http://news.indiewebcamp.com/post/bret.io/2013/06/28/indiewebcamp-2013-roundup/
q.
Comment
To comment on this post, you should:
# Create a "post":http://indiewebcamp.com/post on your own domain
# link to the original post with the "in-reply-to":http://indiewebcamp.com/in-reply-to markup
# add a "u-syndication":http://indiewebcamp.com/rel-syndication link to IndieNews
# send a "webmention":http://indiewebcamp.com/webmention notification
q..
June 2013 - Sandeep Shetty - "Responses":http://www.sandeep.io/79
q.
A response is a post that is a reaction to another URL. Some examples of response types are comment/reply, like, repost/share, mention.
* Each response MUST have it's own permalink.
* Each response MUST have only one response type relationship with a given URL.
A response can be responding to multiple URLs as long as it has only one response type relationship with each of those URLs.
q..
h2. WebMention Endpoint Listing
Within the target's HTML header info:
code.
code..
h2. 21Oct2013
waterpigs made webmention post to aaronparecki.
* http://aaronparecki.com/notes/2013/10/18/1/realtimeconf
* http://waterpigs.co.uk/notes/4Sc41/
* http://waterpigs.co.uk/notes/
#junco - #juncotodo - #indieweb - #comments