+ https://thewinnower.com/papers/now-i-am-become-doi-destroyer-of-gatekeeping-worlds
Amy added 'The Winnower | DIY Scientific Publishing' to Bookmarks
+ https://thewinnower.com/papers/now-i-am-become-doi-destroyer-of-gatekeeping-worlds
Amy added 'The Winnower | DIY Scientific Publishing' to Bookmarks
If you can see this, my micropub endpoint works :D
And if you can see this, I can also edit posts.
Last modified:
Testing a post with a location, although lat/long isn't displayed yet, so you won't see it. (Yet).
Last modified:
Amy added 'Draw Science' to Bookmarks
defaults test and reply test
test defaults and reply
"Micropub is an open API standard that is used to create posts on one's own domain using third-party clients. Web apps and native apps (e.g. iPhone, Android) can use Micropub to post short notes, photos, events or other posts to your own site, similar to a Twitter client posting to Twitter.com." (Micropub on Indiewebcamp)
This means I can now publish blog posts to my site using other peoples' posting clients, of which there are several. Previously, I was ftping markdown files to my server, then running a slightly unreliable PHP script to process the queue based on when the files were last updated. Which mostly worked, but when it didn't it was a pain to untangle.
I wasn't expecting to have a micropub endpoint any time soon because it needs you to be able to sign into your site with IndieAuth. Fortunately, thanks to amazing work of aaronpk and others, most of the legwork has been done here, and you can delegate your IndieAuth; in your site <head>
:
<link rel="authorization_endpoint" href="https://indieauth.com/auth" />
<link rel="token_endpoint" href="https://tokens.indieauth.com/token" />
Then create a micropub script (eg. micropub.php
) and make it discoverable in the same way:
<link rel="micropub" href="https://rhiaro.co.uk/micropub.php" />
Initially I wanted my endpoint at https://rhiaro.co.uk/micropub
and set an .htaccess
rule to redirect to the PHP script. This doesn't work; POST requests can't follow redirects.
Next, here's a bare minimum PHP script to store things posted to your site with a micropub client. This just dumps the POST
request to a text file, which is where I started to see if it would work. What I actually do now is turn posts and metadata into triples and insert them into my triplestore, but you probably don't want to hear about that :)
<?
// Tell client where I can syndicate to
if(isset($_GET['q']) && $_GET['q'] == "syndicate-to"){
header('Content-type: application/x-www-form-urlencoded');
echo "syndicate-to[]=twitter.com%2Frhiaro";
exit;
}
// Check for post
if(!empty($_POST)){
$headers = apache_request_headers();
// Check token is valid
$token = $headers['Authorization'];
$ch = curl_init("https://tokens.indieauth.com/token");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array(
"Content-Type: application/x-www-form-urlencoded"
,"Authorization: $token"
));
$response = Array();
parse_str(curl_exec($ch), $response);
curl_close($ch);
// Check for scope=post
// Check for me=https://rhiaro.co.uk
$me = $response['me'];
$iss = $response['issued_by'];
$client = $response['client_id'];
$scope = $response['scope'];
if(empty($response)){
header("HTTP/1.1 401 Unauthorized");
exit;
}elseif($me != "https://rhiaro.co.uk" || $scope != "post"){
header("HTTP/1.1 403 Forbidden");
exit;
// Check that something was posted
}elseif(empty($_POST['content']){
header("HTTP/1.1 400 Bad Request");
echo "Missing content";
}else{
// DO YOUR THING HERE
// ie. insert post content and metadata into your store, write it to a file, whatever you do to add it to your site.
// For demonstration purposes, let's dump the POST request into a file and return the URL of the file.
$fn = "posts/".time().".txt";
$h = fopen($fn, 'w');
foreach($_POST as $k => $v){
$data .= "[$k] => $v<br/>";
}
fwrite($h, $data);
fclose($h);
// Set headers, return location
header("HTTP/1.1 201 Created");
header("Location: ".$fn);
}
}
?>
I got this far by working through the instructions as part of setting up Quill, so that's a good place to start!
Finally you can get my blog post content in a number of different formats. You'll notice alternative URLs (noted currently as 'Permalink') in the metadata section of a normal view of a post. Hit this up with no Accept header, and you'll get neat markdown (which is what I authored it in; the 'source', as it were).
Browsers automatically send Accept: text/html
, in which case they are redirected to the rendered HTML version of the post you're probably reading now. But here are some alternatives you can try:
curl https://rhiaro.co.uk/llog/micropub-test
-> plain markdown.
curl -H "Accept: application/json" https://rhiaro.co.uk/llog/micropub-test
because there's obviously not enough JSON in the world. Note this isn't correct JSON-LD yet. I'll sort that out another time.
curl -H "Accept: text/turtle" https://rhiaro.co.uk/llog/micropub-test
Ohemgee! RDF! It's what you've all been waiting for, I know.
For those of you who like angular brackets, you could try:
curl -H "Accept: rdf/xml" https://rhiaro.co.uk/llog/micropub-test
Briefly discussed with Tantek, Aaron and Bret at IWC Cambridge and on IRC about how a micropub client could fetch post content for editing. Many people aren't editing raw HTML as it's presented on the page, but maybe markdown or some other syntax, so a client needs to be able to discover this (the 'source') to present it to be edited. Now if someone makes their client check a post for a rel="source"
or shoots off a request with Accept: text/plain
(less likely, since static sites can't do conneg) then they'll get my markdown directly (uh, when I actually put rel="source" in my HTML, which I haven't yet).
As a related aside, I also return source="markdown"
if a micropub client asks my endpoint q=source
.
I meant to watch House of Cards this evening, but I accidentally implemented likes, reposts, bookmarks and proper display of replies on my site.
Amy added http://indiewebcamp.com to https://rhiaro.co.uk/bookmarks/
+ https://linkeddata.github.io/SoLiD/
Amy added https://linkeddata.github.io/SoLiD/ to https://rhiaro.co.uk/bookmarks/
+ http://www.w3.org/Social/track/
Amy added http://www.w3.org/Social/track/ to https://rhiaro.co.uk/bookmarks/
+ http://www-public.telecom-sudparis.eu/%7Eberger_o/publications.html
Amy added 'Publications' to Bookmarks
Amy added http://git2prov.org/# to https://rhiaro.co.uk/bookmarks/
+ http://indiewebcamp.com/How_to_set_up_your_realtime_feed
Amy added http://indiewebcamp.com/How_to_set_up_your_realtime_feed to https://rhiaro.co.uk/bookmarks/
Recently I've been trying to wrap my head around the implicit vs. explicit post types debate (in the Social Web WG, indieweb community, and elsewhere). Here is some analysis of the different perspectives, and report on my own experiences so far.
I think each side of the debate about explicit vs implicit types are misaligned, due to conflation of Objects and Activities. I think Objects (like blogposts) needn't have explicit types, but Activities (like the act of creating a post) should do.
Thanks to Tantek, Aaron, elf Pavlik, Chris and everyone whose conversations I've listened in on in #social and #indiewebcamp IRC channels for discussing this stuff with/around me.
Indieweb development starts with thinking about UI. The reason for thinking about different kinds of posts comes from a desire to display some posts differently to others. But rather than declaring them outright, one can infer how to display them based on the properties of a post (see also IndieWeb Posts by aaronpk.
"explicit post/object types are architecture-centric design, rather than user-centric design" - tantek, #indiewebcamp irc
Another rationale against explicit post types is that it encourages posting clients to constrain users regarding what kind of posts they can create.
"...content types dictate the kinds of content you actually allow people to create with your software" - benwerd, The tyranny of content types
Most mainstream social networks now have a generic posting interface, that allows one to add things like photos, videos, people tags, etc, without forcing you to choose what type of post you want to make first.
Some people started with explicit post types and ran into problems when structuring their software around this idea. TODO: Citation from aaronpk in irc in March/April that I can't find right now.
If you include a slug for a post type in your URLs and decide to change the post type, this is definitely a pain. I figured this pretty early and dropped it from Slog'd. See also: Update URL Scheme issue for p3k.
On the other hand:
"but including type [in URL] because I like clustering by type in a day" - tantek, #indiewebcamp irc
... which I think relates to querying, discussed later.
Often photo-type-post vs article-type-post is thrown up: ie. if you start with an article, then edit it to add a photo, does the post type change? I completely agree that typing based on content doesn't make sense here. When I talk about post types, I'm referring to types for like, bookmark, repost, log/metrics (eg. food, sleep), where they may look like a note in terms of content, but aren't. I display different icons for all of these at the moment, and you'll note that twitter for example displays retweets differently in the timeline.
Conclusion: in the indieweb community, so far, everything created is considered a post
(a h-entry
in microformats), and display differences can be inferred from properties of the post.
title
.like-of
.in-reply-to
.ActivityStreams2.0 has explicit object types and explicit activity types. It's easy to conflate them; I think this is what is happening when discussing types in AS2 with indieweb people, and I certainly had this problem for a while.
Taking an action generates an Activity
, which might result
in an Object
(like a post).
Contrary to indieweb stuff so far, AS2 allows for the idea that not every action on the social web results in a post. Having been immersed in indieweblogworld for ages, this was briefly a hard sell, but then I started to think of social actions (activites) I might want to take - that it's reasonable to want to publish in a feed - that I probably don't need to create a post for. Eg:
I don't publish any of these activities on my site yet. There are some activities I do publish with posts (or plan to imminently), that don't necessarily (I might need convincing on some fronts) need to be posts:
An Activity
can be generated for any action.
Create
activity, for which the object
is the post created. Save
activity, for which the object
is the page and the result
is a post about my having bookmarked the page. Update
activity for which the object
is the post being edited, but there is no new post as a result
.Like
activity for which the object
is the post being liked, but there is no new post as a result
(if you're into that sort of thing, so far I'm not).I strongly feel that all Activity
should have URIs so that if it doesn't result
in a post, it can still be interacted with (eg. you can like my edit). (However, this presents another point for confusion: when do I like a post, and when do I like the fact you published it (the create activity). Anyway, this is for another time..).
Since activities are generated as a result of an action, not explicitly created by a user (unlike objects), arguments for not explicitly typing them fall down:
If you want to generate an activity stream from your actions, we do get an additional argument for explicit types of objects: it makes it much easier to generate a suitable Activity
.
Explicit types for objects or activities make it easy to query by type. Inferring types - particularly from a combination of properties - complicates this a lot. I recently temporarily dropped quicklinks to /articles and /notes in Slogd after removing sioc:BlogPost
and sioc:MicroblogPost
as explicit post types made it suddenly more complicated to get them. Given a stream of many people's activities from all over the place how do you filter for specific things?
Displaying an activity (the fact that someone did something) is different to displaying an object. You might want to form a sentence ("alice likes bob's tweet") without caring what the properties of the object
or possible result
are. It's easier to figure out how to display it if it just has a type, without needing to follow links to the object
or possible result
to infer what's going on.
I guess... If you want to take a bunch of objects and generate an activity stream from them, and they don't have explicit types, it's totally up to you (an implementation detail, aka plumbing) how you decide what types the corresponding Activity
s have.
I'm not sure if it would be nice to have something in the AS2.0 spec to help with consistently deciding how to infer activity types from object properties. Maybe it doesn't matter.
...Wait, is this ISSUE-4? Lack of explicit mention of activities or objects makes it hard to tell.
Activity
.Activity
-generating action needs to result in a post, but it's cool if it does.Activity
s need types. Object
s (like posts) do not (necessarily).Activity
types.I went through the lists of Activity
types and Object
types in current draft of AS2.0 vocab and did a first pass at things I am using, might use and probably won't use. I'll publish this in another post.
I drew lots of diagrams of how I'd turn my different types of posts into Activity
s based on their properties (how I'd infer activity types from object properties). I'll also type these up for another post.
Activity
is a subclass of Object
in AS2. Practical and conceptual differences could be discussed in more depth, but include things like ephemerality of activities vs objects.
Further discussion (possibly): https://lists.w3.org/Archives/Public/public-socialweb/2015Apr/0048.html
Last modified:
+ https://www.w3.org/wiki/Activity_Streams/Examples
Amy added https://www.w3.org/wiki/Activity_Streams/Examples to https://rhiaro.co.uk/bookmarks/
+ https://as-test-harness.mybluemix.net/#about
Amy added https://as-test-harness.mybluemix.net/#about to https://rhiaro.co.uk/bookmarks/
+ https://www.w3.org/Social/track/issues/27
Amy added https://www.w3.org/Social/track/issues/27 to https://rhiaro.co.uk/bookmarks/
I'm really jealous of everyone in Seoul for CHI2015 right now.
Live demo'd my blog sparql endpoint at the pub, pretty sure I'm the coolest
What happens if I don't specify a publish date?
Woot! it worked.
In reply to:
woot? worked!
+ http://www.jwz.org/blog/2015/04/youtube-has-finally-destroyed-their-rss-feeds/#comment-161869
Amy added http://www.jwz.org/blog/2015/04/youtube-has-finally-destroyed-their-rss-feeds/#comment-161869 to https://rhiaro.co.uk/bookmarks/
So SPARQL DESCRIBE
queries are literally 8x slower than an equivalent CONSTRUCT { ?s ?p ?o . }
. Who knew? Not me. Maybe this isn't news to anyone who knows anything about graphs and/or query languages.
Aaaaas usual it's my code, not someone else's, that is causing my problems. Hashtag interop.
+ https://github.com/e14n/pump.io/blob/master/API.md
Amy added https://github.com/e14n/pump.io/blob/master/API.md to https://rhiaro.co.uk/bookmarks/
+ https://modelviewculture.com/pieces/in-defense-of-twitter-feminism
Amy added https://modelviewculture.com/pieces/in-defense-of-twitter-feminism to https://rhiaro.co.uk/bookmarks/
+ http://microformats.org/wiki/social-network-portability
Amy added http://microformats.org/wiki/social-network-portability to https://rhiaro.co.uk/bookmarks/
+ https://gist.github.com/hectorcorrea/dc20d743583488168703
Amy added https://gist.github.com/hectorcorrea/dc20d743583488168703 to https://rhiaro.co.uk/bookmarks/
I'm supposed to be working, so instead I'm making a list of wee annoying bugs in Slog'd that I could and should fix fairly easily this weekend:
Amy added https://gnu.io/social/try/ to https://rhiaro.co.uk/bookmarks/
Making parrot toys out of cardboard, twine, and... mostly parts of old, dismantled parrot toys.
In talk by a computer scientist to social scientists on crawling for SNA. Q: 'is it ethical?' A: 'yes data is public'. Resisting challenge about expectation of privacy cos I want to go to the pub. But honestly, damn computer scientists.
+ http://eua.be/News/15-04-09/EUA_launches_Open_Access_checklist_for_universities.aspx
Amy added 'EUA > EUA launches Open Access checklist for universities' to Bookmarks
Just listening to / reading discussions and debates in W3C groups is tiring; taking part even a tiny bit is exhausting, and I haven't decided if the reward is worth the brain-melt yet. I hope so. I admire all these people who manage to do standards work full time.
+ http://werd.io/2015/discussing-indiewebcamp-edinburgh-is-super-weird-if-you-believe-in-owning
Amy added http://werd.io/2015/discussing-indiewebcamp-edinburgh-is-super-weird-if-you-believe-in-owning to https://rhiaro.co.uk/bookmarks/