#dev 2020-12-26

2020-12-26 UTC
[dmitshur] joined the channel
#
[dmitshur]
Oh, I just learned IndieAuth the protocol has been updated to have a response_type=code.
#
[dmitshur]
Gotta update my implementation.
strugee joined the channel
#
Loqi
[Aaron Parecki] IndieAuth Spec Updates 2020
geoffo, [tantek] and gRegorLove joined the channel
#
aaronpk
GWG: have you used openweathermap.org?
#
aaronpk
i think i'm switching to that one
#
GWG
I have
#
GWG
I think my API access was revoked
#
GWG
I use a combination of things
#
GWG
NWS is good enough most of the time
#
aaronpk
revoked? why?
#
aaronpk
the free tier rate limits seem pretty high
#
GWG
I don't know, something about abuse. I think Home Assistant polled it too much
#
aaronpk
it says 60 per minute
#
aaronpk
is the limit on the free tier
#
aaronpk
which is...a lot
#
GWG
aaronpk: I should investigate
#
GWG
I have a lot of redundancy
plenglin, [chrisaldrich] and [dmitshur] joined the channel
#
[dmitshur]
yay, did a successful deploy from darwin/arm64 to the https://dev.dmitri.shuralyov.com staging instance (I'll take it as close enough to completing the task I set out to do at the start of IWC Create Day).
[KevinMarks], nickodd, nekr0z, blade82 and Daniel joined the channel
#
Daniel
I am trying to set up indielogin on my website, but I am running into issues. any info would be helpfull. I added my own domain to client_id but it errors out with `This client_id is not registered (https://rafaj.dev/)` Where do I need to register my domain ?
#
Daniel
I am trying to set up indielogin on my website, but I am running into issues. any info would be helpfull. I added my own domain to client_id but it errors out with `This client_id is not registered (https://rafaj.dev/)` Where do I need to register my domain ?
#
Loqi
Daniel Rafaj
#
Loqi
Daniel Rafaj
#
Guest76300
So far I am only able to sign in with indieauth to wiki page for example, however I haven't set up any endpoint on my domain yet. this was not clear to me, if I need to.
#
sebsel
Daniel: Guest76300: I don't think registration is open yet. At least, it seems like a form for it is still in progress: https://github.com/aaronpk/indielogin.com/issues/20
#
sebsel
(it is in beta)
#
Loqi
[aaronpk] #20 Add client registration form
#
sebsel
Would be nice if there was a warning about that on https://indielogin.com/api
#
Guest76300
yea, that one is confusing a bit. So, I am not able to use indielogin on my own website for auth, and I need to roll my own indielogin solution/host it ?
#
sebsel
So to be clear: you want OTHER users to log in to YOUR site, using this, right?
#
sebsel
I think that part is limited atm.
#
sebsel
I am still using the now deprecated indieauth.com for that.
#
Guest76300
yes, that is correct. I am trying to figure out which peaces I need to host and which I don't have to. and first is login, so webpub and websub can use that. am I correct in thinking that ?
#
sebsel
my webpub you mean Micropub?
#
sebsel
what is micropub?
#
Loqi
Micropub is an open API standard (W3C Recommendation) for creating, editing, and deleting posts on websites, like on your own domain, supported by numerous third-party clients and CMSs https://indieweb.org/Micropub
#
sebsel
what is webpub?
#
Loqi
WebSub (previously known as PubSubHubbub or PuSH, and briefly PubSub) is a notification-based protocol for web publishing and subscribing to streams and legacy feed files in real time https://indieweb.org/WebPub
#
Guest76300
yes, sorry. I still haven't got hang of the correct terms.
#
sebsel
It's okay!
[Rose] joined the channel
#
[Rose]
That's why we have a chat, bots, and a wiki.
#
[Rose]
Between those hopefully you'll find the right things :)
#
sebsel
If your goal is to authenticate use Micropub for your own website, you don't need IndieLogin.com for that.
#
Guest76300
I am running my website in netlify for now, and building it with SSG so I am trying to find out if I need to host other small services to make socialreader on my website work.
blade82 joined the channel
#
sebsel
So you want to be able to use socialreaders to read other people's blogs?
#
Guest76300
exactly, on my own domain.
#
sebsel
That last part I don't get.
#
Guest76300
I will integrate https://github.com/alltogethernow/web together reader into my website.
#
sebsel
You can authenticate to those external services, using your domain as an identity identifier.
#
Loqi
[alltogethernow] web: Together web client
#
sebsel
I am just confused on your goals... you want to host those yourself?
#
sebsel
I don't think you need IndieLogin.com for that either.
#
sebsel
So, most of those use a protocol called IndieAuth, I think that's the one you're looking for.
#
sebsel
what is IndieAuth
#
Loqi
IndieAuth is a federated login protocol for Web sign-in, enabling users to use their own domain to sign in to other sites and services https://indieweb.org/IndieAuth
#
Guest76300
Could you tell me what parts do I need to host ? if any ?
#
sebsel
That is 'you -> signing in to other apps', while IndieLogin.com is 'other -> signing in to your site, possibly using IndieAuth'
#
Guest76300
I do have indieAuth implemented and working.
#
sebsel
okay, then you should be able to log in to hosted services like Aperture.
#
sebsel
If you want to host Aperture, you need to host Aperture.
#
Guest76300
yes, I will dig into that, I will first try to use, then selfhost most likely.
#
sebsel
okay! So, then if you got IndieAuth working, you should just be able to log in to https://aperture.p3k.io/ using that, to try it out
#
Guest76300
on together github page ```To use it, you'll need a website that supports Micropub, IndieAuth and Microsub.``` After Aperture, only part missing is MicroPub which I will host, so I can post content from different apps/websites.
#
sebsel
Yes, you'll need an endpoint that builds your SSG site after a micropub request, I think.
#
sebsel
what is ssg?
#
Loqi
Static site generators are programs that take a set of flat text files on disk and transforms them into a set of static html files ready to be served by a standard web server, or some variation of this example https://indieweb.org/SSG
#
sebsel
There are some examples listed under 'IndieWeb Examples', please check out those.
#
sebsel
I don't have experience with SSG, so I can't help with that :)
#
Guest76300
don't worry about that part, I already found something very similiar to what I need, I might tweak some things for it to work but I will work that out.
#
Guest76300
I made work, now I can read in external reader, :))
#
Guest76300
I will try to integrate one of the js reader to my website. is There specification for that ?
#
Guest76300
what is reader
#
Loqi
A reader in the context of the indieweb is the portion/feature integrated into an indieweb site that provides a way to read content from other indieweb sites and respond (like, comment, repost, etc) inline on the site itself directly while reading posts https://indieweb.org/reader
nekr0z joined the channel
#
sebsel
what is Microsub?
#
Loqi
Microsub is a proposed standard for creating a new generation of social readers that decouples the management of subscriptions to feeds and the parsing/delivering content from the user interface and presentation of the content https://indieweb.org/microsub
#
sebsel
That would be the spec
#
Guest76300
okey, thank you for very helpful assitance.
#
sebsel
yw :)
#
Zegnat
Always exciting to bring in new technology in your development chain, jeremycherfas!
#
jeremycherfas
Exciting or scary?
#
Zegnat
Bit of both?
#
Zegnat
I haven't touched Bower in years. Did not even know they deprecated
#
jeremycherfas
Indeed. Is there any reason not to load e.g. chartist.js in the HEAD rather than in the body? I got an error because it was loading after the script that called it, but I know I have also seen advice to lead things at the end of the BODY
#
Zegnat
It depends on what is in the script and what sort of performance benchmarks you are aiming for ...
#
Zegnat
Putting <script> at the end of body means that a) they do not block the browser from rendering the rest of the page, and b) when they load you may not need things like OnDOMDocumentLoaded because the DOM is already complete.
#
Zegnat
Because JS has the document.write() function that can write HTML into the page, by default browsers will stop HTML rendering and parsing when they see a <script>. So putting them in your <head> can slowdown the site.
#
Zegnat
Although that is probably not your biggest concern.
#
jeremycherfas
OK, I think I understand. And, to be a further pest, when the instructions say "Once you have included a plugin in your project" is there a specific method to include the plugin?
#
sebsel
That depends on your project...
#
Zegnat
For Chartist you mean? No.
#
sebsel
(we should become consultants Zegnat, always start with "it depends...")
#
Zegnat
You have to make sure both the Chartist.js and the plugin's JS file are loaded. Then in your own JavaScript when you initialise Charist you define the plugin's function in the plugins array as per the documentation.
#
Zegnat
That should be all that is required.
#
jeremycherfas
And that is where I get lost ... Because I am essentially cargo-culting. So, I did the Bower installs for chartist and a test, simple plugin. Copying the example code exactly, I get an error `Uncaught TypeError: Chartist.plugins is undefined`
#
Zegnat
Are you loading the plugin's JavaScript before Charist's JavaScript?
#
jeremycherfas
Ah, so I have to load the plugin. Right. Let me try that. I thought Bower might do that.
#
Zegnat
It may be that the plugin is dependent on Chartist existing already
#
Zegnat
I am not sure what Bower does and does not do. But I *think* it only "installs" (download JS projects into folders) things for you. Not actually magically load things in your HTML/browser.
#
Zegnat
fought against starting that sentence with "It depends on what Bower does..." ;)
#
jeremycherfas
I think maybe I have to have a `require` statement somewhere in chartist.js
#
sebsel
Do you set up chartist in your own code somewhere?
#
jeremycherfas
Because the two different example codes use a different name for the plugin. One has `ctPointLabels` and the other has `Chartist.plugins.ctPointLabels`. Neither works, and I am guessing that somewhere I need to define the plugin name.
#
jeremycherfas
I just load it.
#
Zegnat
If you load the plugin with a <script src="plugin.js"> it should already give itself a name
#
sebsel
looking at the documentation, you need to call `new Chartist.Line('.ct-chart', {...})` at some point to use it, right?
#
sebsel
it is at that point where you insert information about plugins it seems
#
jeremycherfas
Yes Sebsel, I call it it like that, with a secrtion for plugins, and that is where I get the undefined error
#
Zegnat
Yes.Chartist.Line('.ct-chart', {...}, {plugins:[ctPointLabels)]}) ... I think
#
Zegnat
And for that to work, ctPointLabels must exist
#
jeremycherfas
Which, I think, it does, because I have ` <sscript src="/bower_components/chartist-plugin-pointlabels/dist/chartist-plugin-pointlabels.min.js"></script>`
#
sebsel
with `sscript`?
#
Zegnat
Ah, yeah.
#
jeremycherfas
bangs head on desk
#
Zegnat
Haha, woops
#
Zegnat
If the file loads, you should be able to load it in the plugins array as Chartist.plugins.ctPointLabels()
#
jeremycherfas
Well, now I get a different error that I can explore after lunch
#
Loqi
sebsel has 2 karma in this channel over the last year (6 in all channels)
#
Loqi
zegnat has 34 karma in this channel over the last year (93 in all channels)
#
jeremycherfas
See you in a while.
#
Zegnat
eats a mini stollen and calls it lunch
#
sebsel
I was about to walk too, so I am happy that I can without risking tears on your side :)
#
Zegnat
Oh, apparently I do have a project for today. It looks like YouTube has (finally) removed their OPML export button
#
jeremycherfas
Woohoo. No tears. Big smailes.
enpo joined the channel
#
jeremycherfas
Does it make any difference whether you install with Bower or npm?
#
Zegnat
They are just tools for managing JS dependencies. If all you are installing is Chartist + plugins, you can also put the files in a folder manually
#
jeremycherfas
Everything was going well with an "official" chartist plugin, and then I installed the one I want to use and I get an error because it uses `root['Chartist.plugins.legend'] = factory(root.chartist, root.jquery);`
#
jeremycherfas
Not sure I am installing jquery. Better check that.
#
Zegnat
Ah, yes, sounds like that plugin requires jquery
#
jeremycherfas
Yup, that was it. WooHoo, again.
#
Loqi
giggles
#
jeremycherfas
Very tempted to call it a day now as a solid, local success.
[davidmead] joined the channel
#
[davidmead]
[grantcodes] Together is down with a NGINX 502 error
#
jeremycherfas
If I want to use this with Grav, I have to figure out where to install the components; Grav has an `/assets` folder that might be the best place, because I can address it from the Twig templates.
#
Zegnat
jeremycherfas: that does sound like the right place then, yes :)
#
Zegnat
Does Grav expect user uploads in there? E.g. it does not reset the assets folder when it updates? Otherwise you may want to look into what folders are earmarked for your theme
#
jeremycherfas
I'm pretty sure it does not update thta, and will investigate.
#
jeremycherfas
But there is also a whole thing called the Asset Manager that I am reading about.
#
Zegnat
Alternatively you might be able to package it as a plugin. I bet Grav has plugins that support loading JavaScript assets :)
#
jeremycherfas
Yup. Looking into that too. Ideally, it would only be loaded on pages that need it.
DanC, nickodd and geoffo joined the channel
#
@oluoluoxenfree
↩️ Your thoughts are really useful lol! Yeah that's a good point, even when like two people were reading my blogs the comments were super super useful. I should probably enable webmentions on my blog posts, I heard disqus isn't great privacy wise, but yeah, very true.
(twitter.com/_/status/1342862353981956097)
#
@AndreJaenisch
↩️ Oh, you're on Twitter? Nice! I couldn't tell from your website :( My current project is running with ProcessWire. I'm afraid, I won't be able to add Webmentions there anywhen soon.
(twitter.com/_/status/1342863052253884420)
#
jeremycherfas
What the heck is https://github.com/projectdiscovery/nuclei and why is it looking at my site?
#
Loqi
[projectdiscovery] nuclei: Nuclei is a fast tool for configurable targeted scanning based on templates offering massive extensibility and ease of use.
#
sknebel
it's a tool to scan for vulnerable websites, and presumably its looking at all the sites it can
#
jeremycherfas
And then what? seems nefarious to me.
#
sknebel
probably is
#
sknebel
I treat this mostly as background noise. if you have something online, people will be scanning it. you can't entirely stop it, and its a good question how much effort to invest into trying to block it.
#
jeremycherfas
That is largely my attitude too, after having taken some basic precautions.
[snarfed] joined the channel
#
[snarfed]
jeremycherfas just fyi the standard white hat (ie no nefarious) use for that kind of tool is to scan and protect _your own_ web site(s)
#
[snarfed]
definitely valuable
#
Zegnat
GWG: we had a discussion about times on events.indieweb.org a while back. JS has the Intl API that also implemented methods like DateTimeFormat in browsers. That lets the timestamps display in 24-hour vs 12-hour format depending on the browser locale.
#
GWG
Zegnat: What about the Accept Language header?
#
Zegnat
It does seem to include currency formats in the Intl.NumberFormat API, but nothing for temperature :(
#
GWG
Convert it for en-US but otherwise no?
#
Zegnat
That is probably the way to go if you want to do it server-side
#
GWG
Server side suits me
#
Zegnat
If you want to do it in-browser and not have entire conneg in the backend, you should look at `window.navigator.languages`
#
Zegnat
Honestly, for caching, search engines, etc.etc. I would probably avoid conneg here and do it in browser. But milage may vary *shrug*
#
[snarfed]
obligatory conneg--
#
Loqi
conneg has -4 karma over the last year
#
[snarfed]
high five loqi
#
Zegnat
And this is coming from me, I actually like conneg for format negotiations :P
#
GWG
I'm going to finish up the backend code to switch it regardless. How I trigger will come later
#
Zegnat
I am just not sure about it for language negotations
#
GWG
For now, I fixed the inconsistencies in storage.
#
GWG
It always stores in celsius and converts
#
Zegnat
Good to settle on a storage format for sure
#
GWG
I did that a while ago, but there are still some bugs I had to fix and check. Even with metric, do you store visibility in meters or kilometers...etc
alex11 and [jeremycherfas] joined the channel
#
[jeremycherfas]
Right. But then it wouldn’t be a surprise in my logs.
cweiske and [fluffy] joined the channel
#
aaronpk
dammit week counting is hard
#
sebsel
you have a nice test case this year as there is a week 53 (right?)
#
aaronpk
i was hoping adding 1 to the week number would just work, and it does most of the time
#
aaronpk
like asking for the 54th week of 2020 gives you the first week in 2021
#
aaronpk
but apparently not always
#
Zegnat
I think I have done the "modify by +7 days" thing in PHP to move by weeks
#
aaronpk
yeah i think i need to switch to that
#
aaronpk
i was just doing the simpler +1 and -1 to the week number for the next/prev links, and it *mostly* works
#
aaronpk
e.g. week 0 of 2020 is the last week of 2019
#
Zegnat
$date->modify('+7 days')->format('W') gets you next week's week number. Assuming you have a date.
#
sebsel
which year does not work?
#
Zegnat
Not sure how the wrapping of week numbers work. Week numbers always seem a little annoying because of ISO weeks vs years vs w/e
#
aaronpk
the other problem is when the start of the week is in a different calendar year
#
aaronpk
there's an "ISO year" vs "year" available in PHP too which fixed some of them but broke others
#
Zegnat
Oh yeah, if you want to combine week numbers with year numbers, you need the ISO year ones
#
aaronpk
ooh i see i forgot to change one of the years to ISO year
#
aaronpk
yep that was it
#
aaronpk
might as well fix my links anyway tho
#
aaronpk
i left the canoncalization in there tho. so `/2019/week/99` redirects to the right week in 2020 :)
#
sebsel
!march
#
Kaja
It's March 301, 2020 (UTC)
#
sebsel
Don't know if you need to take that into account...
#
vilhalmer
it'd be funny to have a special case for /2020/march/NNN
#
aaronpk
i should make URLs for every day from march 1-300
#
aaronpk
haha jinx
#
Loqi
Aaron Parecki
#
aaronpk
should work up to 999
#
sebsel
lol aaronpk++
#
Loqi
aaronpk has 71 karma in this channel over the last year (218 in all channels)
#
vilhalmer
aaronpk++
#
Loqi
aaronpk has 72 karma in this channel over the last year (219 in all channels)
#
Zegnat
Awww, it is not universal? https://aaronparecki.com/2019/03/300 = server error
#
aaronpk
tbh i guess it would be easier to make it universal
#
Zegnat
Sorry I broke things again xD
#
aaronpk
also i should avoid server errors anyway
#
sebsel
But March 2019 just had 31 days, Zegnat
#
aaronpk
actually no it's not easier to do it everywhere
#
aaronpk
well at least now it just returns 4040
#
Zegnat
If the year+month is valid, set to the first day of said month, then do a modify of + x-1 days taken from the URL. Then you get the "actual" day?
#
aaronpk
Zegnat: yes, but i said "easier" :D
#
Zegnat
Oh, sure, I don't know how you did it for march 2020, of course, so may not be easier
#
Loqi
[Aaron Parecki] march.php
#
Zegnat
Ah yeah
#
Zegnat
Disclaimer: never ran in a PHP evaluator, just winging it
#
aaronpk
TIL `checkdate`
#
aaronpk
but in any case i like that march 2020 is handled specially anyway :)
#
Zegnat
Yeah, March 2020 is definitely something different.
#
Zegnat
Just wanted to show what I had in my head when I wrote about how I would support the wrapping
#
aaronpk
`checkdate` certainly makes that easier
#
vilhalmer
I love that checkdate takes args in the weird american date order instead of hierarchically lol
#
Zegnat
Yes, if you did not know about that function it definitely explains why I thought it was easy and you foresaw problems :D
#
Zegnat
vilhalmer: if anything, PHP is not known for consistency of function arguments
[Raphael_Luckom] joined the channel
#
[Raphael_Luckom]
"Beware of bugs in the above code; I have only proved it correct, not tried it." - Knuth
#
Zegnat
Hehe. Yeah. My gist should be seen as PHP code that works when evaluated by my mind. Whether it works with an actual PHP evaluator remains to be seen ;)
#
aaronpk
TIL Zegnat has a PHP interpreter in his head
#
sebsel
So I wanted to joke that PHP should just look at the names of the variables used in `checkdate()` and then you would be able to use hierarchical order too
#
sebsel
but then I remembered PHP 8 actually does this. https://stitcher.io/blog/php-8-named-arguments
#
aaronpk
oh cool
#
aaronpk
i think i like this
#
aaronpk
i've decided to not read the counterarguments since apparently the decision has already been made :)
#
Zegnat
I like it. No more passing null or looking for default values when you want some arguments set and others not.
#
sebsel
haha, I think I like it too, but indeed, I'll stop worrying about it right away
#
aaronpk
sometimes i just make one parameter, an array, and look for values in that array. this seems like a much better built in solution to that
#
Zegnat
I think Python has had this for a while now? Think I also used it in R. It makes it very easy to keep track of what you are doing.
#
vilhalmer
I always prefer named args when they exist
#
vilhalmer
python has always(?) let you pass things either positionally or named
#
vilhalmer
recent releases let you restrict to one or the other
#
vilhalmer
restricting to named only makes changing your api much easier
#
[Raphael_Luckom]
one of my favorite uses of destructuring in JS is that it gives you named-args for function callers, but the syntax is basically the same number of characters as positional arguments: `function a(b, c, d}` (positional) vs `function a({b, c, d})`(named)
#
[Raphael_Luckom]
using that pattern you can add arguments at arbitrary places without having to correct every call site
[KevinMarks] joined the channel
#
@TomLisankie
↩️ Trying to build this into the next version of @RoamanPub. Take a look at linkback protocols like Webmention btw https://en.wikipedia.org/wiki/Linkback
(twitter.com/_/status/1342929703603204097)
craftyphotons__ and geoffo joined the channel; nickodd left the channel
#
aaronpk
why would i have changed my <table> to use grid/flexbox instead of the default browser table layout?
#
aaronpk
there's a commit "switch month table to flex/grid/flex layout"
#
aaronpk
hm i think it has something to do with firefox
#
[KevinMarks]
Wrapping behaviour?
#
aaronpk
ah yeah now i remember the challenge. there's probably a better way though
#
aaronpk
i'm trying to have flexible height cells, but have two parts to the cell so i can have some content stuck at the bottom and some at the top
#
aaronpk
but i can't use position: absolute because then the contents in the bottom part don't affect the height of the cell
#
sebsel
you did that on an IndieWebCamp somewhere in Europe, I think, because I remember you working on it
#
Zegnat
Oh, yeah, pretty sure there was a browser where every icon had gone out of the cell previously
#
aaronpk
yea that sounds familiar
#
aaronpk
well quick fix for now
#
sebsel
it's all so nice, esp. the little bicycle
#
aaronpk
well that was fun but what i was really supposed to be doing was pulling in my fitbit data
#
aaronpk
i'm worried that because i'm doing all this work on my site now and not traveling, i'm not accounting for all the weird edge cases anymore
#
aaronpk
things like when I lose a day due to the date line, or my day has more than 24 hours
#
sknebel
guess you should invest in some test cases :D
#
sknebel
replay 2017-2019 with dates set in the future to your site and see what changes :D
cweiske, DanC and KartikPrabhu joined the channel