#dev 2017-10-30

2017-10-30 UTC
EmreSokullu joined the channel
#
oodani
Is OpenID still worth implementing? It's obviously worse than IndieAuth, but there do still seem to be places that accept it. (For instance, PyPI, which I'm on a lot since I'm working in Django.)
#
KartikPrabhu
oodani: I think Indieauth can be used as OpenID fallback. aaronpk should know more
singpolyma joined the channel
#
aaronpk
You can delegate to IndieAuth.com if you don't want to implement OpenID from scratch
#
oodani
Hmm, might be worth doing. I'd assume my IndieAuth approval prompt would only "see" IndieAuth.com rather than the actual OpenID client, though.
#
aaronpk
Well it's easy to try out. https://IndieAuth.com/openid
#
aaronpk
there aren't that many places that consume it still tho, and there are even fewer OpenID providers left
#
aaronpk
i have a bunch of users on IndieAuth.com who moved there from myOpenID.com when it shut down, cause they still wanted to be able to sign in to stack overflow
#
tantek
including me :)
#
aaronpk
but IMO its not worth investing much time in
#
aaronpk
OpenID 1 is effectively dead, the OpenID foundation has moved on to OpenID Connect which is based on OAuth 2 and also doesnt even serve the same goal as OpenID 1 did
#
tantek
aaronpk I wonder if we can update the /OpenID dfn to reflect that summary status
#
tantek
what is OpenID
#
Loqi
OpenID is a method of using an HTTP URL as an identity for signing into websites https://indieweb.org/OpenID
#
tantek
1 and 2 both pretty dead right?
#
tantek
and OIDC is like you said totally different
#
aaronpk
yeah 1 and 2 are officially deprecated according to the openid foundation
#
oodani
Yeah, delegating to IndieAuth.com means my site only actually sees IndieAuth.com, not the OpenID client. Makes sense, I guess.
#
aaronpk
that's how delegating to any openid 1 server works yeah
#
oodani
Oddly enough, it doesn't even work on PyPI? Maybe they don't do delegation properly. Works fine on Stack Exchange though.
#
aaronpk
its so hard to debug too
#
oodani
Probably not gonna bother with it. You're right, it's pretty pointless now.
#
Zegnat
Does IndieAuth.com OpenID work now? It used to fail for me on StackExchange when I used my own IndieAuth endpoint.
#
oodani
Hmm, with Stack Exchange it goes through to my site fine, but comes back to IndieAuth.com/ rather than being sent to SE.
#
oodani
So, probably not, then. :P
#
Zegnat
Ah, alright, I was hopeful for a second there ;)
#
Zegnat
Well, I am off for bed. Have a good one all!
#
tantek.com
edited /OpenID (+290) "update dfn to indicate dying nature, official deprecation, replaced by, criticism Hard to debug"
(view diff)
#
tantek
what is OpenID
#
Loqi
OpenID was a protocol for using a web address as an identity to sign-in to websites; it is losing support, is effectively dead (versions 1 & 2 are both deprecated), and has been replaced on the IndieWeb with web-sign-in and IndieAuth https://indieweb.org/OpenID
#
oodani
Is there something I can put on my site to make IndieAuth.com automatically delegate /IndieAuth/ requests to my site, rather than simply using my own IndieAuth as a verification method? (So that I get the correct client_id and icon, and also don't have to pick which provider to use.)
#
tantek.com
edited /OpenID (+49) "dfn, note/link sites dropping support"
(view diff)
#
aaronpk
i was able to log in to stackoverflow just now
#
aaronpk
using the twitter verification option of indieauth.com
#
aaronpk
oodani: i think there's an open ticket for that right now on indieauth.com. but... dont worry too much about it, for reasons i would love to get in to
#
oodani
Oh wow. Okay. :P
#
oodani
Feel free to get into them. ;)
#
aaronpk
it's... complicated, and im in the middle of a project to straighten things out
#
Zegnat
oodani, it also depends on the website. E.g. Telegraph should send you straight to your site. It is only websites like the wiki that do not use IndieAuth themselves but use specifically the IndieAuth.com service for login that force you to go there.
#
aaronpk
the short version is you will only ever interact with indieauth.com when youre logging in to sites that dont implement their own login flow, like the wiki.
#
oodani
Hmm, Yeah, fair enough.
#
oodani
Oops, capital Y there.
#
oodani
Authenticating with Stack Exchange worked when I used Twitter verification, but not GitHub verification (I got a "csrf_detected" error).
#
aaronpk
ultimately i would like it to skip showing you indieauth.com when youre logging in to the wiki but it's an optimization thing really
#
aaronpk
oh weird yeah ive heard a couple other reports about that, but i havent figured out whats wrong with the github flow
#
Zegnat
Yeah, it seems to be an error specific to using the IndieAuth option for logging in to StackExchange.
#
oodani
The thing is that https://indieauth.com/developers encourages you to just use IndieAuth.com rather than try to discover the user's correct authorisation endpoint, so it seems like that'll end up with /lots/ of IndieAuth clients that have to go through that extra step.
#
Zegnat
That’s because that is the developers page for indieauth.com, and not for indieauth.net (the OAuth extension)
#
aaronpk
haha welcome to the party ?
#
Loqi
rofl
#
Zegnat
Or well, details and discussion and resolution all in one little section
#
Zegnat
Now I really should be off for bed, because IndieAuth has a tendency to keep me up ;)
#
oodani
"IndieAuth.com will become IndieLogin.com." ?
EmreSokullu joined the channel
#
aaronpk
yep and also i'm launching a fork of it on myindieauth.com
#
aaronpk
to play the other role, where the user doesnt want to build their own authorization endpoint
#
oodani
Ooh. So that version will *just* support email/PGP/social verification?
#
aaronpk
and if a site is using indielogin.com and you have your own authorization endpoint, you'll never even see the rel=me login options or even see the indielogin.com site
#
aaronpk
i'm hoping that helps clear things up
#
oodani
Sounds good to me. c:
#
aaronpk
i have this started in a development branch already. it's a lot of work tho!
#
aaronpk
updating docs, fiddling with those flows, etc
#
oodani
oh, totally! there's always a lot to do with these things :o
#
oodani
so will indielogin.com delegate across to myindieauth.com for users that need to use email/pgp/social?
#
aaronpk
heh i hadnt thought of that
#
oodani
i'm in a microservice frame of mind today, apparently :p indielogin.com could do absolutely nothing besides delegate to the user's auth endpoint or to myindieauth.com if they don't have one
#
aaronpk
interesting point
#
oodani
that means only myindieauth.com needs an id+secret for twitter and github, which i think is an advantage - although i guess making more oauth apps is free anyway
#
oodani
and you could also reuse the same id+secret if you wanted, i s'pose
eli_oat and [tantek] joined the channel
#
aaronpk
it would make the implementation of indielogin.com super small
#
oodani
yeah! :3
tantek, snarfed, KartikPrabhu and EmreSokullu joined the channel
#
eli_oat
AHOY! Potentially stupid question but I can't find an answer in the docs: how does, or can one, update a post via quill? If so, how?
#
eli_oat
HARK! Never mind: found it in a related closed issue on github. Edit posts with this sort of URL https://quill.p3k.io/edit?url=[some_post_of_me]
#
tantek
eli_oat perhaps add it to an "FAQ on indieweb.org/Quill ?
#
eli_oat
On it!
#
tantek
eli_oat++
#
Loqi
eli_oat has 3 karma in this channel (4 overall)
#
eli.li
edited /Quill (+152) "/* Features */ Added a bit of info about editing posts"
(view diff)
#
eli_oat
Also, long time no post to IRC! Been lurking a bunch
renem and [miklb] joined the channel
#
@John316Network
http://bit.ly/LPDoor - The Door is free. #IARTG #Kindleebooks #mustread #readers #Kindletouch #indieauth #IAN1pic.twitter.com/8LCenVAYrJ
(twitter.com/_/status/924841440902914048)
#
aaronpk
Whoa I forgot that Quill has any kind of edit support
tantek joined the channel
#
tantek.com
edited /to-do (+152) "/* Blog Update to Call For A Distributed Web */ include refs to rhiaro's thesis"
(view diff)
EmreSokullu and mblaney joined the channel
#
mblaney
bridgy++ I finally got around to adding quote-tweet support to dobrado, and it worked first time :-)
#
Loqi
bridgy has 2 karma in this channel (62 overall)
#
tantek.com
edited /hwcpdx (+19) "linky linky"
(view diff)
#
tantek.com
edited /Portland (+10) "link hwcpdx, espand dfn"
(view diff)
gRegorLove joined the channel
#
mblaney
ahhh, except I use bridgy_omit_link=true for short posts, but I'm still counting the original tweet.
sebsel, jqzollmqqe, KartikPrabhu, [shurcool], cweiske and [kevinmarks] joined the channel
#
vanderven.se martijn
edited /comments (+373) "/* IndieWeb Examples */ Add Henrik Carlsson and call out how he is displaying comments within feeds too"
(view diff)
#
cweiske
could you add a screenshot for that comment-in-feeds?
EmreSokullu joined the channel
#
jacky.wtf
edited /Jekyll (+51) "/* IndieWeb Examples */"
(view diff)
#
Zegnat
cweiske, I was thinking about it, but it becomes such a big image on the page then. As you can’t illustrate it without actually screenshotting the whole feed.
#
cweiske
the wiki support thumbnails
#
Zegnat
True, I’ll try and make something that shows off the example
#
cweiske
thanks
#
Zegnat
Whatever Hendrik is using to grab the comments doesn’t support the authorship algorithm. My photo and name don’t show up :(
#
jacky.wtf
created /User:Jacky.wtf (+61) "Created page with "I'm Jacky. I host and talk about things at https://jacky.wtf/""
(view diff)
#
Zegnat
cweiske ^^^
#
cweiske
oh, thank you!
#
vanderven.se martijn
edited /comments (+91) "/* Henrik Carlsson */ Add (probably) page breaking thumbnail"
(view diff)
#
cweiske
he doesn't have rss/atom or h-feed
#
Zegnat
Well, even as thumbnail, that messes with the /comments page a lot
#
cweiske
or link to the wiki file page itself without a preview
#
cweiske
but I don't know how to do that.
#
Zegnat
Going to leave it for now, as it is the only screenshot on the entire page.
#
Zegnat
Also, not only no h-feed, no h-entry’s either
EmreSokullu joined the channel
#
cweiske.de
edited /feed_reader (+193) "/* Examples */ add type column"
(view diff)
EmreSokullu joined the channel
EmreSokullu joined the channel
#
petermolnar.net
edited /SQLite (+112) "/* IndieWeb Examples */"
(view diff)
EmreSokullu and [kevinmarks] joined the channel
#
@ellenbroad
Hey twitter, I need all your phrases and slang terms for crappy code (spaghetti code, a ball of mud, etc). @ me with favourites.
(twitter.com/_/status/924786379334213632)
arush and snarfed joined the channel
#
snarfed
ok [kevinmarks] i had a little too much fun with that :P
John___, jeremycherfas, EmreSokullu, aaronpk, tantek and grantcodes joined the channel
#
aaronparecki.com
edited /database-antipattern (+86) "/* Fragile */ xkcd"
(view diff)
#
aaronpk
what is analytics?
#
Loqi
analytics is the collection, analysis and reporting of a websites traffic https://indieweb.org/analytics
#
aaronpk
just stumbled across Open Web Analytics since it's available as a DreamHost one-click install
#
aaronpk
there's a section on the wiki page for it but no info lol
#
sknebel
analytics << Do_Not_Track
#
Loqi
ok, I added "[[Do Not Track]]" to the "See Also" section of /website-analytics
#
loqi.me
edited /website-analytics (+19) "sknebel added "[[Do Not Track]]" to "See Also""
(view diff)
snarfed1, [miklb], jeremycherfas and arush joined the channel
#
aaronpk
oh boy something's going on with my server
#
aaronpk
redis keeps dying
Loqi_, aaronpk and EmreSokullu joined the channel
#
aaronpk
let's see if a reboot fixes it
#
aaronpk
let's see if a reboot fixes it
#
[miklb]
cweiske++
#
Loqi
cweiske has 21 karma in this channel (119 overall)
#
[miklb]
hmm. I might have jumped the gun, but I’m I’m able to send a micropub like with a syndication target for a like
#
[miklb]
but my site didn’t set the syndication target
#
[miklb]
I suspect that is between the WordPress plugin and silo.pub however
#
sknebel
grantcodes: as you say, the base tags should be handled by the parser, but see my other issue with your solution.
#
grantcodes
sknebel: hmm there is definitely code in the mf2 parser to handle base tags
#
sknebel
grantcodes: well, in my tests it doesn't :P
#
grantcodes
but maybe still because I'm not using the res.url?
#
sknebel
on my branch as well
#
sknebel
(that said, I was testing on node, maybe the browser DOM it works correctly)
#
sknebel
(which is still bad since microformat-node is still broken then, but -shiv might be "fine")
#
grantcodes
yeah not sure how reliable the node dom parsing is
#
grantcodes
Decent enough usually
#
grantcodes
Do you have a live url you're testing on?
#
sknebel
hang on, I don't need a fixed plugin to test that, basetag would supply the url
#
grantcodes
I also have a test suite I can share, it's just a bit hacky so it's not in the repo
#
Zegnat
Hmm, I feel like that microformat-shiv code is suspect. If you BASE element URL is a relative one (which I think is allowed by HTML?) it is going to turn the URL into a relative one again.
#
sknebel
Zegnat: it doesn't even seem to work with an absolute one
#
Zegnat
Oh, it reads like it should work with absolute ones.
#
sknebel
(try logging into that test page above
#
Zegnat
throws hands in the air
#
tantek
like you just don't care?
#
sknebel
grantcodes: btw, if you need a project I bet there's more to find in the JS parser :P
#
sknebel
and glenn hasn't been doing anything on it recently, not even merging my old PRs
#
Zegnat
More like taking my hands off of it, tantek ;) We may need to hunt for a new maintainer on JS mf2
#
tantek
sknebel: try pinging him on Twitter
#
sknebel
grantcodes: Zegnat: the code you linked also seems to only use the <base> tags if you don't supply an URL, that's wrong too
#
grantcodes
mf2 parsing is too complex for me to try and build myself at the moment
#
[miklb]
hmm. I guess I was thinking I could use silo.pub as a syndication target to trigger a like
#
grantcodes
sknebel: so your example should resolve to https://www.svenknebel.de/testing/abra for the auth url?
#
tantek
Zegnat or at least a co-maintainer
#
sknebel
(since the "official" testing site is down, this is mine, running microformats-node with my open PRs already applied though)
#
tantek.com
edited /post (+488) "/* Brainstorming */ What to post / Anniversaries of projects or activities"
(view diff)
EmreSokullu joined the channel
#
aaronpk
*whew* just cleaned up my dreamhost account and set up nightly backups of everything
#
tantek
hey GWG, per our recent discussion, I'm going to keep adding to https://indieweb.org/post#What_to_post every time I think of something to post and reach sufficient motivation to succesfully do so. hope that helps!
#
Zegnat
Why is it my perfectly valid HTML always unearths these tricky bugs, sknebel, grantcodes, ... :P
#
grantcodes
sknebel Zegnat one (kinda weird) option would actually be to just host the php version somewhere, enable cors and just request the mf2 json from that. But always prefer not to have these middleman services
#
Zegnat
That would leak all endpoint information of every user to the middleman. Wouldn’t recommend that.
#
sknebel
grantcodes: agreed, not great. might be worth checking if there is a good dedicated solution just for rel links...
#
grantcodes
isn't that all already public anyway?
#
tantek
not your usage thereof
#
tantek
it's potentially another form of monitoring/logging
#
tantek
behavior analysis for ad targeting etc.
#
sknebel
would have to check/think about where else the it uses the mf2 parser and if the bugs matter there (if introducing another dependency for rel links. wouldn't be surprised if <base> tags are ignored in most tooling though. clear edge case :/)
#
Zegnat
Also takes away the possibility of using the code in browser extensions (like Micropub clients) that are meant to work with development versions of software. The middleman can’t access localhost.
#
grantcodes
Cool, let's rule out that option then
#
Zegnat
sknebel does the node-microformats version you run on sturdy-backbone live somewhere in a repo?
#
sknebel
Zegnat: yep, my fork of it
#
Zegnat
What branch?
#
sknebel
https://github.com/sknebel/microformat-node/tree/patchy-shiv - I just noticed glenn did changes since then
#
grantcodes
So all my library needs to get is the auth, token and micropub endpoints (maybe rel=me links would be useful too) - if there is another way of getting those I'm all for it
#
Zegnat
Hmm. Wonder if it is worth it making a fresh fork of glenn's then and merging in your changes manually, and then going from there.
#
Zegnat
I don’t like the idea of working on -node and -shiv simultaneously though
#
aaronpk
you don't need a microformats parser to get the rel values
#
sknebel
aaronpk: any recommendations of working JS libs (browser side) for it that respect base tags?
#
grantcodes
for my use case, needs to work in browser and node!
#
sknebel
Zegnat: https://github.com/sknebel/microformat-node/blob/patchy-shiv/package.json#L35 - my -node version for that also loads my -shiv version as a dependency
#
aaronpk
search for "link rel parser"
#
aaronpk
that's really what you're doing
#
sknebel
we have a mf2 parser anyways
#
sknebel
so yes, we can add another thing, but if we can fix the mf2 parser instead
#
sknebel
(at least I assume microformats-shiv used for the highlight-thing as well)
#
Zegnat
Wait. -node depends on -shiv? Now I am really confused as to what sets them apart, haha.
#
Loqi
awesome
#
sknebel
Zegnat: -shiv is an mf2 parser working on a DOM. -node just supplies a DOM in nodejs and does some adapting around that, the parser is in -shiv
#
sknebel
to a very large part at least
#
sknebel
(the obvious npm hits for alternatives seem broken as well)
#
sknebel
https://developer.mozilla.org/de/docs/Web/API/Node/baseURI - this looks like it might help to get a <base> value from the DOM. unclear if available in the node-DOM though, just noting it for now
#
Zegnat
Or at master, sorry, whenever you go through search you always end up at specific commits: https://github.com/glennjones/microformat-shiv/blob/master/lib/url.js
#
sknebel
in what context is that used? I'm not quite sure what it does and when and how
#
Zegnat
I see no obvious problems with that method, so as long as all URLs go through modules.url.resolve() stuff should be peachy.
#
Zegnat
modules.url.resolve(url, baseUrl) - “resolves url to absolute version using baseUrl”. Code seems fine. So as long as that is used everywhere there shouldn’t be any issues.
#
sknebel
but the problem is finding the base url, not applying it. I thought
#
sknebel
since if you pass it in expicitly it gets applied
#
Zegnat
https://github.com/glennjones/microformat-shiv/blob/master/microformat-shiv.js#L341-L348 - seems to suggest baseUrl is overwritten by whatever is in the BASE element?
#
Zegnat
The only problem there is that it should have used modules.url.resolve when baseUrl is already defined, in case of a relative value in the BASE element
#
sknebel
and the fact that it doesn't work on our example page with an absolute base url
#
Zegnat
Yeah, that is surprising. Reading the code, it should just be taking that URL :/
#
sknebel
except if this.document has a value in L319
#
sknebel
if that exists and has an empty url for some reason...
bengo joined the channel
#
Zegnat
L319 is empty?
#
Zegnat
Are we looking at different versions?
#
Zegnat
Pizza is here. And after dinner I need to get back to the studies. Postpone this ’til thursday? Haha
#
sknebel
yeah, I should start going home as well
#
Zegnat
Ah, I was looking in the compiled -shiv file. I’ll pass my eyes over parser.js after pizza.
#
Zegnat
Have a good one
#
tantek
ooh pizza
tantek joined the channel
#
martymcgui.re
edited /Homebrew_Website_Club (+630) "/* Promoting an HWC event */"
(view diff)
#
sknebel
Just devoured a slice as well (yay for Italian place in the train station)
EmreSokullu and snarfed joined the channel
#
grantcodes
aaronpk: quick question - any way I can automate the micropub.rocks tests for unit tests? Think I would just need to get some of the random strings generated
#
aaronpk
i hadn't really planned on it being used for automated testing
#
grantcodes
fair enough
#
grantcodes
Just easier than writing my own tests ?
KartikPrabhu and [kevinmarks] joined the channel
#
aaronpk
i'm surprised there aren't more services that offer stats for podcast downloads
#
[kevinmarks]
Well, the stats people want are playbacks rather than downloads
#
aaronpk
i mean that's not a thing, but what people are doing right now is tracking downloads
#
aaronpk
it just seems to be bundled with podcast hosting
#
aaronpk
the wordpress plugin has stats built in so at least you can self-host that pretty easily
tantek joined the channel
#
[kevinmarks]
Hm, I wonder if the archive.org stats measure downloads
raretrack joined the channel
#
Zegnat
sknebel: that if on L319 doesn’t matter, as the baseTag is detected on L328 and falls outside of that if-block. The if from L319 just tries to detect the current page URL when running in the browser in case no other URL was provided.
#
Zegnat
It should get overridden on L332 by whatever the BASE element provided. So for your absolute URL in BASE, that should work :/
#
sknebel
Zegnat: my mistake, due to the indentation I thought it was in the except block
#
sknebel
catch blog
#
Zegnat
He. Yeah, the indentation is a little annoying for reviewing code.
#
sknebel
Zegnat: grantcodes: seems like only rel-urls aren't normalized
#
sknebel
so the bug is in the code extracting them, not the general handling of base tags
#
Zegnat
Ah. They don’t use the modules.url.resolve() ?
#
sknebel
haven't found the source yet
#
Zegnat
Oh, OK, I thought you hit jackpot there
#
grantcodes
Ah ok. I was actually just playing with getting the rels myself without the library
#
Zegnat
That might be a good idea regardless, grantcodes ;)
#
sknebel
yes, for micropub-helper it makes sense to do that
#
grantcodes
Yeah, the only thing that might be an issue is the base tag thing. Apart from that I think it will be amost as simple as querySelectorAll('[rel]')
#
Zegnat
grantcodes: check querySelector('base'), if it exists, resolve its href value and set that to the new base URL. Then resolve all hrefs from *[rel] matches to the current base URL.
#
Zegnat
You have to resolve URLs for the *[rel] anyway, so you need that code no matter what.
#
sknebel
yeah, I kind of had forgotten earlier that "we have an mf2 parser anyways" is only true in the browser extension, not the helper
#
grantcodes
sknebel: The full parser is in there just now, but not really using the functionality of it anyway
#
Zegnat
If that type check is wrong it shouldn’t be adding *any* URLs, sknebel, or am I reading this wrong? So the type check must be passing…
#
sknebel
that's what I meant. omnibear is using it for other things, your micropub-helper doesn't need it
gRegorLove joined the channel
#
sknebel
Zegnat: true. well, somewhere there is the bug probably ;)
#
Zegnat
Also, why is this all in while loops? When did for-loops get outlawed?
#
Zegnat
I know I should not be riffing on coding choices, I am just a little frustrated that all code looks OK yet we are having problems :P
#
Zegnat
goes to make tea
#
sknebel
found it
#
Zegnat
Looking forward to it
#
grantcodes
Zegnat & sknebel here's my 33 line function for getting rel links: https://gist.github.com/grantcodes/5eb16ffc6246d4b4c05b01e93c369396 look ok to you guys?
#
grantcodes
* only frontend for now
#
sknebel
grantcodes: only the first <base href=> counts, so break the loop once you set a base url
#
sknebel
and the href can be relative
#
sknebel
so you should also resolve it to the initial baseUrl
#
grantcodes
Oh cool! didn't know that about multiple base elements
#
sknebel
just add a break after L13
#
sknebel
oh, return probably since .forEach not a real loop
#
sknebel
or however you get out of those
#
sknebel
I just realized I don't know of the top of my head
#
grantcodes
I'll just make it not a loop
#
sknebel
the first <base> could not have a href attribute
#
grantcodes
Ah edge cases!
#
sknebel
you have to check until you used one
#
grantcodes
queryselector(base[href])?
#
sknebel
that should work
#
sknebel
and the values of rel="" is a space-seperated list
#
sknebel
so <link rel="authorization_endpoint token_endpoint"... is valid
#
grantcodes
I assume that's only if the href is the same yeah?
#
Zegnat
grantcodes, you don’t need `if (value !== null) {` for the base element, do you?
#
grantcodes
refresh the gist, it's updated a bit
#
grantcodes
oops didnt update
#
sknebel
sure, a link element only has one href, the value applies to all links listed in rel=
#
Zegnat
Does this mean we all have experience with pair programming now?
#
Zegnat
goes to update his CV ;(
#
sknebel
Zegnat: you didn't before? ;)
#
sknebel
also, might be a good idea to lowercase the rel values, since they are case-insensitive
#
sknebel
and clean out duplicate URLs
#
sknebel
that's all I can think of right now
#
sknebel
aaronpk: sadly, that seems quite useful
#
aaronpk
i can't believe it's come to this ?
#
Zegnat
yeah, lowercase rel values, then split on ' ' (space) because one element can have several rel names
#
seblog.nl
edited /Strava (+177) "Strava now supports 'posts' / notes"
(view diff)
#
Zegnat
If you change relEls to doc.querySelectorAll('[rel][href]') you will not need to check the attributes for null, I think, as both rel and href must exist on the element
#
grantcodes
Haha thanks guys, so the gist is updated to find the first base element with a href attribute and handle space separated rel attributes. (I left in that null check just in case :P)
#
Loqi
hehe
#
sknebel
grantcodes: one thing: split(" ") doesn't handle multiple spaces between two tokens, so filter out the "" in the names.forEach
#
Zegnat
This could theoretically lead to duplicate entries. Otherwise I don’t see any problems
#
grantcodes
Oh yeah, don't think the duplicates matter for my use, but I'll filter them anyway :)
#
Zegnat
I am surprised neither sknebel nor I had a function ready for this, with all the URL resolution crap we have read throughout the years ?
#
sknebel
Zegnat: not in JS certainly
#
sknebel
oh, and sorry, another thing... despite being called "space seperated tokens", "The space characters, for the purposes of this specification, are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), and "CR" (U+000D)."
#
sknebel
(newlines in attributes, really?)
#
Zegnat
Hmm, I wonder if DOMParser doesn’t normalise that for you. Never tested.
#
sknebel
good point, it might
#
Zegnat
If you didn’tt want a general rel extraction grantcodes,you should just have done document.querySelector('[rel~="micropub"][href]').getAttribute('href') and resolved that ;)
#
grantcodes
Hmm or maybe the fetch call I use?
#
grantcodes
Zengat: also need token and auth endpoints so looping was less verbose, plus may expose the other values I get at some point
#
Zegnat
Oh definitely, just my tongue-in-cheek answer to your “don't think the duplicates matter for my use”. Pay no heed, haha'
#
sknebel
tested, DOMParser doesn#t clean it up
#
Zegnat
Hmm, pity
#
grantcodes
gross, any easy way to split on all those characters?
#
grantcodes
or I guess replacing them with a normal space character would be easier
#
sknebel
.replace() with a regex, all whitespace to single " "?
#
Zegnat
Define the separator in .split() as a regex group of all those chars should work
#
Zegnat
.split(/[ \r\t\n]/)
#
Zegnat
and whatever FF is in regex...
#
grantcodes
Regexes - another thing I dont understand :P
#
Zegnat
At least it will cut out the replace middle step
#
grantcodes
good old stackoverflow came up with .split("\\s+")
#
Zegnat
JS recognises that as regex instead of string? OK.
#
Zegnat
Note that \s matches more whitespace characters than the ones sknebel cited: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-white-space
#
Zegnat
Although at some point it might be better to give up on reinventing the entire HTML parsing and go for the easy answer.
#
sknebel
yeah, \s should be good enough
#
grantcodes
It's impossible to have whitespace in urls isn't it? So should be fine
#
sknebel
not urls, rel-values. but yeah, shouldn't happen
#
Zegnat
Give it a year and I will have published a page with rel values that break all parsers again, if my track record is anything to go by ?
#
Zegnat
But yeah, \s, discard all empty elements in the resulting array. You don’t even need to do .trim() then.
jjuran joined the channel
#
grantcodes
Alrighty, think that function is sorted now! I'll get it integrated properly and polyfilled in node and push an update
#
grantcodes
Zegnat++
#
Loqi
zegnat has 34 karma in this channel (139 overall)
#
grantcodes
sknebel++
#
Loqi
sknebel has 25 karma in this channel (68 overall)
cweiske joined the channel
#
Zegnat
Cool, hope I was somewhat helpful
#
Zegnat
Off for bed now, alarm at 5 tomorrow morning for the first train to uni. Have a good one all
#
snarfed
aaronpk: i just used https://tttthreads.com/ to unfurl an actual twitter thread, that i actually want to read, and not in their UI
#
snarfed
absurd world we live in indeed
#
sknebel
Zegnat: good night!
[cleverdevil] and tantek joined the channel
#
@zeldman
“Solving only your specific problems will result in lighter, easier-to-understand code.” @rachelandrew #aeasf
(twitter.com/_/status/925117550089736192)
#
@zeldman
“Solving only your specific problems will result in lighter, easier-to-understand code.” @rachelandrew #aeasf
(twitter.com/_/status/925117550089736192)
#
Loqi
ok, I added "https://twitter.com/zeldman/status/925117550089736192" to the "See Also" section of /selfdogfood
#
loqi.me
edited /selfdogfood (+73) "/* See Also */ new section"
(view diff)
#
tantek
ooh that reminds me , need to follow the #aeasf tag
#
KartikPrabhu
I follow @zeldman and he's very good at live-tweeting imp points
#
loqi.me
edited /longevity (+132) "tantek added "2017-10-30 André Staltz: [https://staltz.com/the-web-began-dying-in-2014-heres-how.html The Web began dying in 2014, here's how]" to "See Also""
(view diff)
snarfed joined the channel
#
tantek
henrikcarlsson++ for http://blog.henrikcarlsson.se/2017/10/microcast-on-inline-comments-and-indieweb-cmses/ - very cool, and great use of the microcast medium
#
Loqi
henrikcarlsson has 1 karma
#
KartikPrabhu
what is microcast?
#
Loqi
microcast is a podcast that is shorter than typical podcasts, usually under 10 minutes long https://indieweb.org/microcast
#
sknebel
are 4 hour podcasts then macrocasts?
#
KartikPrabhu
are inline comments there marginalia?
#
tantek
does some math
#
tantek
gives up on the exaggerated use of "micro", realizes he has no place to complain about that
#
tantek
sknebel: perhaps megacasts
#
loqi.me
edited /tweetstorm (+110) "tantek added "[https://tttthreads.com/ Thread Reader] - unrolls a full Twitter thread on a single page for easier reading" to "See Also""
(view diff)
#
Loqi
snarfed has 16 karma in this channel (307 overall)
#
tantek
what is a solution in search of a problem
#
Loqi
It looks like we don't have a page for "solution in search of a problem" yet. Would you like to create it?
#
snarfed
went a little overboard
#
snarfed
had fun
#
tantek
wonders if we actually have all those
#
tantek.com
edited /antipatterns (+78) "plumbing first is a common subset of "solution in search of a problem""
(view diff)
#
tantek
snarfed, what do you mean by "does this even compile?" is that really a common dev/coding problem?
#
tantek
also confused by undefined behavior - is that a code bug or a spec bug?
#
tantek
is dog science just a meme-worthy renaming of pseudo-science
#
tantek
I think I understand "hope is not a strategy" (have heard that approach called "aspirational" for short)
#
tantek
CADT wow I can't even
#
gRegorLove
doge science?
#
tantek
and with that I've lost my attention span for the rest of the list
#
snarfed
tantek: if "does this even compile" shows up in a code review, the reviewer obviously has very low confidence in the code :P
#
snarfed
often used more in spirit than literally now, esp since so much code is in interpreted languages
#
snarfed
(but syntax errors could be similar)
#
Loqi
[Ryan Barrett] I often sign off on code reviews at work with “LGTM ??” #dogscience #ihavenoideaifthisactuallyworks #notproud Also on:
eli_oat joined the channel