#dev 2017-05-28

2017-05-28 UTC
[cleverdevil] and KevinMarks joined the channel
#
gregorlove.com
edited /Main_Page () "(-605) /* Homebrew Website Club */ remove past, add more upcoming"
(view diff)
#
gregorlove.com
edited /Main_Page (-473) "/* Upcoming IndieWebCamps */ remove past"
(view diff)
#
gregorlove.com
edited /Events (-1) "archive UXLondon"
(view diff)
KevinMarks_ joined the channel
#
loqi.me
created /Tilt (+184) "prompted by gRegorLove and dfn added by gRegorLove"
(view diff)
#
gregorlove.com
edited /Tilt (+231) "link dfn, clarify dates, archived announcement"
(view diff)
KartikPrabhu joined the channel
[eli_oat] joined the channel
#
[eli_oat]
Does anyone know of a quick and easy way to see an example of the JSON output form a micropub client? I’m trying to work off of the w3.org docs, but I’m not having much luck mapping the incoming data
#
aaronpk
you could point it at https://micropub.rocks cause that shows you the request made
#
[eli_oat]
ah ha! Thanks
#
[eli_oat]
Also, sorry I’ve been so #needy over the last week ?
#
aaronpk
no problem!
#
[eli_oat]
because I’m on a role: I’m trying to do something like this: `$content = $data['properties']['content']['html'];`
#
[eli_oat]
I can tell, now, this is wrong, because that isn’t how to read an array…
#
[eli_oat]
next step, figuring that out
#
aaronpk
So close
#
aaronpk
Try [content][0][html]
#
aaronpk
on mobile sort for syntax errors
#
aaronpk
sorry lol
#
ben_thatmustbeme
Lol, I'm sure on slack that will have come out like a mess
#
[eli_oat]
…yeah, I have no idea what it means, BUT, I’m gonna figure it out ?
#
ben_thatmustbeme
To say it again so slack is Happy, he said [ content ][ 0 ][ html ]
#
ben_thatmustbeme
Have to add spaces or the IRC to slack bridge thinks it's a user name
#
[eli_oat]
Thanks! I also just pulled up the IRC logs to double check ?
#
ben_thatmustbeme
That's my micropub receiving code
#
ben_thatmustbeme
Don't know if it will help or confuse more
#
[eli_oat]
Thanks! I’ll take a look
#
[eli_oat]
I’ve been working to modify/update this guy: https://gist.github.com/adactio/8168e6b78da7b16a4644
#
[eli_oat]
HARK! Thanks. I think this particular nut has been cracked
#
ben_thatmustbeme
I'll be rewriting my whole micropub code soon
#
[eli_oat]
I imagine I’ll need to do that in a few weeks once I actually figure out what I’m doing ?
#
ben_thatmustbeme
Yeah, it's a lot better now, it's stable so things aren't going to change any more
#
ben_thatmustbeme
And micropub.rocks. ..... Rocks
#
[eli_oat]
I am discovering that, more and more
#
[eli_oat]
weirdly, this worked `$data['properties']['content'][0]`, but no dice with `$data['properties']['content'][0]['html']`
#
ben_thatmustbeme
It rather odd if you are expecting html
#
[eli_oat]
word, sorry — I wasn’t clear. This is in different context, using micropub.rock I’m able to get the first scenario to work sans HTML, but the second one, which I think is the correct format, just displays “ARRAY”
#
[eli_oat]
when I try to test it against receiving HTML
#
ben_thatmustbeme
Just test is_array(..[ content ][ 0] )
#
ben_thatmustbeme
If it is an array then look for the html value, if not then it's just a plain text
#
ben_thatmustbeme
PHP isn't good at making an object into a string
#
ben_thatmustbeme
$output =print_r($something, true) if you want to see exactly what it is
#
[eli_oat]
(working on testing this now)
#
[eli_oat]
THAT WORKED!
#
[eli_oat]
now, to figure out how the content is coming across when I use micropub.rocks, but not quill
#
aaronpk
haha I forgot the slack bridge would translate that
#
Loqi
hehe
#
aaronpk
Yeah Loqi this is all your fault
KartikPrabhu and [eli_oat] joined the channel
#
[eli_oat]
I am able to successfully post plain JSON h-entries, and HTML JSON h-entries to my site using micropub.rocks and I am able to post to my site using Quill’s Editor interface. I am not, however, able to post to my site using Quill’s note interface. I’ve tried enabling and disabling Quill’s “Send HTML Content” toggle.
#
[eli_oat]
Has anyone seen anything similar?
#
aaronpk
Quill's note interface will always send non-JSON iirc
#
[eli_oat]
AH, gotchya
#
[eli_oat]
Time two write a new if ?
#
aaronpk
I guess I expected people to add support for JSON posts after they got normal posts working
#
[eli_oat]
That makes sense
#
[eli_oat]
My whole site’s architecture is built around JSON Feed, so I’m sort of JSON-first
#
[eli_oat]
but I can totally support both
#
aaronpk
It should be easy to translate form encoded to JSON
#
[eli_oat]
indeed, I had it working before, I just need to key it off of the response type, JSON v. Form Encoded
#
[eli_oat]
…but should probably go to sleep. I’ve become addicted to staying up all night working on this
#
aaronpk
You should be able to check the content type header
#
[eli_oat]
yeah, I think I saw that in known’s endpoint
#
Loqi
it is probable
#
[eli_oat]
Thanks all for the help this evening!
#
KartikPrabhu
[eli_oat]: building around JSON feed sounds fragile
#
@ScalaWilliam
@ojarjur I'm thinking integrating something like this with WebSub and WebMention to achieve an even higher degree o… https://twitter.com/i/web/status/868710369824432128
(twitter.com/_/status/868710369824432128)
#
Zegnat
Good morning IndieWeb
KevinMarks, jeremycherfas and sebsel joined the channel
#
vanderven.se martijn
edited /events/2017-05-31-homebrew-website-club (+501) "/* US West */ Add Fort Collins, normalise some more stuff."
(view diff)
#
unicyclic.com mal
edited /Micropub/Clients (+14) "Clear fix for floating thumbnail"
(view diff)
#
unicyclic.com mal
uploaded /File:dobrado_micropub_client.png "Screenshot of dobrado posting interface when used as a Micropub client."
#
unicyclic.com mal
edited /Micropub/Clients (+63) "Added screenshot for dobrado"
(view diff)
KevinMarks joined the channel
#
www.svenknebel.de
edited /events/2017-05-31-homebrew-website-club (+0) "/* What */ fix date in u-url u-uid"
(view diff)
#
www.svenknebel.de
edited /events/2017-05-31-homebrew-website-club (-253) "/* Details */ deduplicate"
(view diff)
[eli_oat] joined the channel
#
[eli_oat]
Because it is so young, or is there something architectural that seems fragile? What I'm doing is storing posts as json, constructing a combine view of those posts as a json feed, and then keying UI off of the feed
#
Zegnat
[eli_oat], are you storing any extra meta data, like post kind et al? How are you doing that in JSON Feed?
#
[eli_oat]
It supports arbitrary keys as long as they have a leading underscore.
#
[eli_oat]
And the json of each post isn't necessarily json feed compliant, since it can get reformatted when it is added to the feed view, so I can add extra info no probleeemo
#
myfreeweb
i store json of each post too, but mf2 formatted (each property is an array). i actually store feeds as mf2 objects as well so i can reconfigure them on the fly from micro-panel
#
Zegnat
Ah, alright [eli_oat]. So it is more JSON storage then JSON Feed storage ;) I think that was the only thing KartikPrabhu would have found fragile
#
[eli_oat]
That makes sense. Storing as mf2 formatted json is also a really great idea. Hmmm ?
#
[eli_oat]
Right now I store all my data as plaintext (because I'm stupid obsessed with flat files cmss), but am backing everything up to couchdb. I could reformat on the way to couch to mf2
#
sknebel
myfreeweb I gotta try wire up micro-panel to my site, it seems surprisingly similar to something I wanted to build ;)
#
vanderven.se martijn
edited /jsonfeed (+310) "Update Known info & start documenting IndieWeb extension."
(view diff)
#
sknebel
[eli_oat]: I think you'll find flat-files are very popular around here
#
Zegnat
That update to /jsonfeed I just did needs more work. There is now a _indieweb property extension to JSON Feed committed to Known and definitely worth documenting.
#
myfreeweb
some people prefer jf2 to avoid dealing with the arrays everywhere. but i designed micro-panel around arrays :D
#
Zegnat
If JSON Feed does gain traction we might as well make sure to document IndieWeb-data-in-JSON-Feed from the start
#
myfreeweb
re "obsessed with flat files cmss"… sweetroll started out as json files in git. switching to postgres felt so good
#
myfreeweb
like i could have built some indexing on top of flat files, maybe use a db in addition to files, but i never did any of that
#
[eli_oat]
I spend most of my day managing a couple postgres dbs, so am trying to avoid mostly because of that ?
#
[eli_oat]
"most of my day" is an exaggeration, but a chunk of it, at least.
#
myfreeweb
https://github.com/myfreeweb/mf2sql is my postgres schema. more functions than schema actually :D it can extract nested mf2 objects into separate records when writing, and inline them back when reading. which leads to hilarious bugs sometimes: once i had a micropub client id that was equal to my site's url, it inlined the home feed into the client id property :D
#
Loqi
[myfreeweb] mf2sql: PostgreSQL schema for storing microformats2 JSON objects
#
[eli_oat]
Ooooh that sounds fun
#
[eli_oat]
Also weirdly terrifying?
#
myfreeweb
[eli_oat]: hmm my site didn't like your h-entries https://unrelenting.technology/replies/2017-05-28-11-32-03 no author, no url even. i guess it's probably a good idea for me to add the fetched URL if the url property is missing… but i think everyone publishes permalinks as u-url
#
Loqi
[Greg] Nice. I can also post Markdown :)
#
myfreeweb
but about the author — you should add rel=author to your home link, see https://indieweb.org/authorship
#
[eli_oat]
? I'll add that and take a look at the url issue
#
myfreeweb
also lol i accidentally similar color scheme to yours :D
#
[eli_oat]
I think I'm being a dummy and only include it on the home page
#
[eli_oat]
Woot, similar color schemes!
KevinMarks, [kevinmarks] and [eli_oat] joined the channel
#
[eli_oat]
@myfreeweb I fixed the missing URL issue. As for the author — should that just be on the main page of my domain, or should I add that to each post within the h-entry?
#
ben_thatmustbeme
This all shows more of why I want to unify jf2 and jsonfeed. They are quite similar. But to be able to easily and programmatically change mf2 Json to jsonfeed/jf2 I think would make offloading the conversion super simple and it would gain even more traction
#
myfreeweb
[eli_oat]: since you don't have your h-card as the h-entry's author, adding rel=author to your home link (a href="https://eli.li" title="back") will instruct authorship parsers to go there to find the h-card
#
Loqi
eli hi@eli.li (╯°-°)╯︵ ┻...
#
[eli_oat]
Ah, gotchya!
#
ben_thatmustbeme
In other words I want to just write it once or just use an external service and as long as my mf2 is correct, I know the Json feed /jf2 is correct
#
ben_thatmustbeme
Gets rid of sidecar complaints
KevinMarks joined the channel
#
Loqi
[Greg] Home Articles Replies This entry has been updated. Reload? liked eli ...
#
myfreeweb
(your date format is not ISO 8601 so i can't parse it)
#
myfreeweb
omg loqi
#
[eli_oat]
is 8601 the standard date format folks are looking for?
#
[eli_oat]
I’ve seen some RSS, too
#
[eli_oat]
so wasn’t sure
#
myfreeweb
Atom == RFC 3339 == subset of ISO 8601, idk if RSS uses it, but most things do
#
myfreeweb
note that "ISO8601" in PHP is broken
#
myfreeweb
and you should use "ATOM"
#
myfreeweb
http://php.net/manual/en/class.datetime.php literally DateTime::ISO8601 "is not compatible with ISO-8601" :D
#
[eli_oat]
ah, good to know
#
ben_thatmustbeme
The mf2 parser has some interesting ideas of dates, but it should be quite happy with 8601
#
ben_thatmustbeme
Lol... Oh PHP
#
myfreeweb
the HTML spec shows that format as the "machine-readable format" for time[datetime] https://html.spec.whatwg.org/multipage/semantics.html#the-time-element
#
myfreeweb
and mf2 parsers pick up that attribute
#
[eli_oat]
(making all of these changes over SSH using vim from my phone during my son’s bath has been exciting)
#
myfreeweb
nice
#
[eli_oat]
also dangerously wet for the phone ?
#
Zegnat
I usually stick to the HTML date/time spec.
[barryf], KevinMarks_ and KevinMarks joined the channel
#
www.svenknebel.de
edited /like (+123) "/* mark up and post a like */ word in mf2-properties, link reply-context as other markup option"
(view diff)
#
unrelenting.technology
edited /like (+383) "/* mark up and post a like */ add reply-context example"
(view diff)
#
unrelenting.technology
edited /repost (+511) "/* How to Publish */ add reply-context example"
(view diff)
KevinMarks, jeremycherfas and [cleverdevil] joined the channel
#
[cleverdevil]
@Zegnat I'm the one who added JSON Feed to Known, and added those _indieweb extensions.
#
[cleverdevil]
I'd love to see someone hash out the details and all agree on something that we can use.
#
[cleverdevil]
If a bunch of IndieWeb sites adopt JSON Feed with the extensions, perhaps we can get the extensions "standardized" and baked into the spec itself.
#
Zegnat
I think I credited you correctly on the wiki for that, [cleverdevil]
#
[cleverdevil]
Ah, cool, not so worried about credit, more interested in getting feedback on what I did with the extensions.
#
Zegnat
We’ll see what happens with it. I just started a section for documenting it and was then called away. I might be able to document more of it later
#
sknebel
what is JSONFeed?
#
Loqi
jsonfeed is a feed file in JSON format https://indieweb.org/jsonfeed
[kevinmarks] joined the channel
#
Zegnat
[kevinmarks] I find date parsing a mess in general ;)
#
GWG
I had that PHP DateTime problem last week
KevinMarks joined the channel
#
Zegnat
JSON Feed: so great because the programming languages all have serialisation and deserialisation features! So lets create a Twig template to build our JSON Feed: https://github.com/getgrav/grav-plugin-feed/blob/develop/templates/feed.json.twig
#
sknebel
s/JSON/"XML/Atom"
#
sknebel
(curious to see if they'll check on and try to fix implementations doing that or not)
#
aaronpk
whaaaaat
#
aaronpk
that's crazy
#
sknebel
really? I think its "not surprising"
#
sknebel
(admittedly, that doesn't preclude it being crazy)
[terminalpixel] joined the channel
#
sknebel
Zegnat, you have a grav tessite?
#
sknebel
*test-site
#
Zegnat
Only the clone of Jeremy’s that hangs together with duct tape
#
sknebel
if you feel like it, install the json-feed plugin and a post with "} in the title...
KevinMarks joined the channel
#
Zegnat
Not sure if I should, sknebel. Don’t know if I can keep myself from spending another hour fixing it ;)
#
sknebel
(I know the feeling. I haven't used node or even JS at all in ages and still have spent hours now on looking into microformat-node
#
sknebel
(you know you're going to make me install grav otherwise, right? :P)
#
sknebel
(nah, probably not, to much work)
[eddie] and KevinMarks joined the channel
#
[eddie]
aaronpk: you have a lot of posts that have a static map with gps tracks like https://aaronparecki.com/2017/05/26/29/
#
[eddie]
Obviously the data comes from compass, but do you store the gps file in your post directory too? Or do you just Store the start/end time, and when the static map image is being created, do you just grab the stuff from compass at that moment and only leave the gps in compass?
KevinMarks joined the channel
#
aaronpk
Compass actually posts a file with geojson data of the trip, and my site generates the map from that
#
aaronpk
So I have the raw data from each trip along with the map image stored with each post
KevinMarks and KevinMarks_ joined the channel
#
myfreeweb
https://unrelenting.technology/notes/2017-05-28-23-33-32 ← in case anyone else thought that AWS Lambda is a great fit for an extended micropub media-endpoint thing that does fancy processing (e.g. WebP images in addition to PNG/JPEG) D:
#
Loqi
[Greg] So Amazon Lambda has a 6 MB limit on request (and response) size. Binary files have to be Base64 encoded (LOL) which makes the limit even SMALLER! So my micropub media endpoint chokes on full DSLR resolution photos. Yeah the "right way" is to have th...
KevinMarks joined the channel