#dev 2019-03-20

2019-03-20 UTC
iasai joined the channel
#
[tantek]
Looks like Twitter is downsizing my portrait images down to ~750px wide anyway (and my "medium" resolution is 960px wide) so I won't lose anything to Twitter by syndicating just my "medium" resolution images there
#
[tantek]
Similarly it's only displaying landscape images at ~770px wide. So in either case my 960px "medium" resolution is fine for Twitter.
#
[tantek]
switches flipped. https://tantek.com/2019/077/t1/sunset-crashing-waves-stained-glass now has alt text parseable by mf2 parsers, and all I had to add to my content was a parenthetical after the image URL like this: (Square stained glass)
#
Loqi
[Tantek Γ‡elik] πŸŒ…πŸŒŠ #sunset over crashing #waves, stained glass art @TLChihuahua on Divisadero last night. #art #stainedglass #thelittlechihuahua #tlc #latergram #yestergram #2019_076 https://fastly.4sqi.net/img/general/width960/476_rEjJjzsGjhmyKVnR69OFxbFs1Yb_3sEatCUbrOF9CfI.jpg
#
[tantek]
Twitter << Maximum and recommended resolutions for image and video media posts: https://developer.twitter.com/en/docs/media/upload-media/uploading-media/media-best-practices.html
#
Loqi
ok, I added "Maximum and recommended resolutions for image and video media posts: https://developer.twitter.com/en/docs/media/upload-media/uploading-media/media-best-practices.html" to the "See Also" section of /Twitter https://indieweb.org/wiki/index.php?diff=58328&oldid=56434
[kevinmarks] and [jgmac1106] joined the channel
#
snarfed
[tantek]: re u-photo on link w/bridgy publish...hmm! interesting. i see your u-bridgy-flickr-photo prototype. it's not supported yet. :P i'm open to it...but do you know of any other prior art for u-photo on <a>s? i wonder if there's a more general way to specify multiple alternative urls for a given u-photo. maybe srcset? https://github.com/snarfed/bridgy/issues/592
#
Loqi
snarfed: [tantek] left you a message 34 minutes ago: is u-bridgy-flickr-photo a reasonable feature request for Bridgy Publish, like p-bridgy-twitter-content, but for a custom photo (e.g. higher resolution) for Flickr? Or is that violating "keep Bridgy simple"? Asking before I file an issue requesting it.
#
Loqi
[petermolnar] #592 responsive images with srcset
#
[tantek]
snarfed, the only prior art for u-photo on <a>s is what I've been doing until today πŸ™‚
#
snarfed
np! i figured
#
[tantek]
so I just moved the u-photo to the img so mf2 parsers pick up the alt
#
[tantek]
in this case I only want to send a custom photo URL to Flickr, hence the use of u-bridgy-flickr-photo
#
[tantek]
in contrast to wanting to use srcset in general
#
snarfed
if bridgy had hard-coded logic to use the highest resolution that a silo accepts, would srcset work? do mf2 parsers handle u-photo on srcset?
#
snarfed
not sure i even know know the right q's to ask here
#
Loqi
[tantek] #7 Should u-* parsing special case img srcset?
#
snarfed
would "use highest possible resolution" satisfy your use case?
#
[tantek]
I think if we can figure out how consuming code would like to get at different resolutions, then yes mf2 should parse it
iasai joined the channel
#
[tantek]
and then yes, use highest possible resolution would solve the use case for POSSEing images
#
[tantek]
presumably to all POSSE destinations though right? (which would be ok I guess unless I started to run into destination size limits)
#
[tantek]
I don't really feel good about just kicking the can down the road for handling srcset syntax
#
[tantek]
that is, I'd expect clients consuming mf2json to want something structured for the different image URLs and sizes, rather than a big string to parse
#
Loqi
It looks like we don't have a page for "this: https://haxtheweb.org/f-a-q-" yet. Would you like to create it? (Or just say "this: https://haxtheweb.org/f-a-q- is ____", a sentence describing the term)
#
[tantek]
snarfed, which would you prefer?
#
[tantek]
"srcset": " ... massive string ..."
#
snarfed
oh god
#
snarfed
sure, naturally i'll vote for parsed
#
[tantek]
"srcset": [{url:"...", size:"..."}, ... ]
#
[tantek]
I think I got that right
#
[tantek]
then you have to do your own logic to iterate through the srcset array and look at the "size" values and judge accordingly
#
[tantek]
not sure we can simplify the size values at all, they're already pretty minimal
#
snarfed
yup the latter. i don't really know anything about srcset though so my vote may not count a lot
#
snarfed
almost all image data in bridgy/granary already looks like that structured latter option anyway. (AS1, AS2, all silo APIs, etc). mf2 is the exception
#
[tantek]
wow really?
#
[tantek]
also I'm worried about the nontrivial amount of coding on both the publishing and consuming side to support srcset
#
[tantek]
like literally I don't know of any CMS that provides a UI for multiple resolutions and publishing srcset
#
snarfed
sure. i doubt any of them have alternatives either though, eg to do anything like your prototype. at least not exposed in UI
#
[tantek]
whereas linking a thumbnail (or other medium resolution) to a full resolution is a common (automatic) pattern I believe: user uploads full resolution, CMS downsizes it for "common" viewing pages
#
snarfed
(CDNs, galleries, etc may do it under the covers)
#
snarfed
ah sure, thumbnails yes. mostly automatic, but yes those are in UIs
#
[tantek]
but usually just that - two levels, "normal" and high resolution when you click
#
[tantek]
and maybe small thumbnails / icons in an archive / monthly summary view
#
snarfed
so u-photo on a link should already work right now in mf2, with bridgy publish, etc, right?
#
[tantek]
correct, that has been working for me πŸ™‚
#
snarfed
the blocker for you was u-photo on link *plus* alt, right?
#
[tantek]
<a class="u-photo"><img alt>
#
snarfed
cool. i'm open to srcset or anything else to help there. not sure u-bridgy-*-photo is the best approach, seems much too narrow, but i'm open to discussion
#
[tantek]
that won't be parsed by an mf2 parser in any form of association
#
[tantek]
another approach is if anyone else thinks that a[class~="u-photo"]>img[alt]:only-child pattern is useful more broadly, then we could move that to mf2 parsing
#
[tantek]
u-* that is
#
[tantek]
yet I'm *very* hesitant to do so if I'm the only use-case
#
[tantek]
Yes the u-bridgy-*-photo approach is very narrow, but that also means it is very conservative, and precise, simple, testable, narrowly scoped for all the above
#
snarfed
sure. i just don't know that it helps inform any broader solution(s)
#
[tantek]
Anyway, there's a few options. add srcset to mf2 parsing, add a[class~="u-*"]>img[alt]:only-child to mf2 parsing, add u-bridgy-*-photo to Bridgy
#
[tantek]
see what you think is reasonable / preferred
#
[tantek]
one thought with u-bridgy-*-photo - it only works for single photo posts presumably
#
snarfed
eh no it could be multiply valued
#
snarfed
just like u-photo now
#
[tantek]
unless you treat the presence of a u-bridgy-foo-photo to mean ignore all u-photo for silo foo
#
[tantek]
and then allow u-bridgy-foo-photo to be multivalued
#
snarfed
ah yes, my first pass would be to not mix the two
#
[tantek]
that would be the easiest/simplest for publishers to predictably control as well
#
[tantek]
one or the other. not mixed
#
[tantek]
anyway, next post should be a test of whether Bridgy is seeing my alt text πŸ™‚
#
snarfed
great! feel free to file an issue if it doesn't
#
[tantek]
likely also a multiphoto so that will be a good test
#
[tantek]
AFAIK no one has Bridgy Publish POSSEd a multiphoto to Twitter with alt text on each photo!
#
[tantek]
(do you know of any?)
#
snarfed
it's possible, but i don't know of any examples
#
[tantek]
presumably you tested it πŸ™‚
#
snarfed
i doubt it
#
snarfed
no unit test
#
snarfed
testing the whole cartesian product of features for most products would be...intimidating
#
[tantek]
alrighty then, I'll let you know in a bit πŸ™‚
#
[tantek]
I'm pretty excited about this πŸ˜„
#
snarfed
🀞
iasai and [chrisaldrich] joined the channel
#
Loqi
tantek has 27 karma in this channel over the last year (112 in all channels)
gRegorLove_, [eddie], iasai, [tantek], KartikPrabhu, snarfed, [jgmac1106], [aaronpk] and barpthewire joined the channel
#
[tantek]
alright, multiphoto post on my own site with alt attributes working. now to see if it gets POSSEd to Twitter with the alts!
cweiske joined the channel
#
[tantek]
and multiphoto with alt attributes POSSE tweet success! All four photos here have the respective alt attributes from my original post! https://twitter.com/t/status/1108272612378112000
#
@t
#trailtuesdaythrowback to 13.2+ miles and ~2500' last #Saturday at #SFRC. Clear blue skies, a stark contrast from the previous week’s cold rain! 1 Gravel steps up Miwok 2 Hills and the Pacific from Miwok 3 Miwok looking back towards Tennessee Valley 4… https://tantek.com/2019/078/t1/last-saturday-sfrc-clear-skies https://pbs.twimg.com/media/D2FgDxiX4AAwvv0.jpg
(twitter.com/_/status/1108272612378112000)
#
[tantek]
!tell snarfed congrats! Bridgy Publish a multiphoto to Twitter handled all 4 of 4 alt attributes just fine! https://twitter.com/t/status/1108272612378112000
#
Loqi
Ok, I'll tell them that when I see them next
#
@t
#trailtuesdaythrowback to 13.2+ miles and ~2500' last #Saturday at #SFRC. Clear blue skies, a stark contrast from the previous week’s cold rain! 1 Gravel steps up Miwok 2 Hills and the Pacific from Miwok 3 Miwok looking back towards Tennessee Valley 4… https://tantek.com/2019/078/t1/last-saturday-sfrc-clear-skies https://pbs.twimg.com/media/D2FgDxiX4AAwvv0.jpg
(twitter.com/_/status/1108272612378112000)
#
[tantek]
Bridgy++
#
Loqi
Bridgy has 2 karma in this channel over the last year (4 in all channels)
iasai joined the channel
#
Zegnat
Reading the conversation, nice work on the multiphoto with alt POSSE, [tantek]! :D
#
Zegnat
My first feeling towards a[class~="u-*"]>img[alt]:only-child is a little sceptical. Feels like that would move away from the meaning of u-*. srcset sounds like the right point to work on imo
[tantek], iasai, jamietanna, [Rose], [pfefferle], jamietanna[m] and [kevinmarks] joined the channel
iasai and [jgmac1106] joined the channel
#
jeremycherfas
Can anyone recommend a tutorial for SimpleXML? I am having such trouble wrangling the beast that is the Overcast OPML as arrays that I am looking longingly at a simpler solution, but I have difficulty in grasping how to address nodes. Something that starts with basics would help.
#
Zegnat
Uuh. I’d recommend using DOMDocument instead, which takes away some weird edgecases that SimpleXML has (in my experience)
jgmac1106[m] and [grantcodes] joined the channel
#
[grantcodes]
!tell tantek: re your photo sizes with mf2 I ended up having to use data elements for my use case, which is slightly different. I know it's not best practice but lets parsers pick up the highest res images. Not tried it with alt attributes yet though
#
Loqi
Ok, I'll tell them that when I see them next
#
jeremycherfas
OK zegnat; is there a good place to learn about DOMDocument that you would recommend?
#
Zegnat
I am actually looking around if I find any good tutorials, jeremycherfas :)
#
jeremycherfas
Thanks! In the meanwhile, I am going to go for a little walk to clear my head. Maybe I will come back with a solution to filleting my array.
#
@jgmac1106
↩️ it is so perfectly simple. I use webmentions. So a badge is a reply post to student evidence that includes badge image, name, issuer, earner, criteria and evidence. All done by two Urls talking to each other... Will do summary write up… https://quickthoughts.jgregorymcverry.com/2019/03/20/_mike_collins-it-is-so-perfectly-simple-i
(twitter.com/_/status/1108345581041303557)
#
@jgmac1106
Here is an MVP mockup of webmention badges http://edu307.glitch.me/ and because it uses microformats there are real life consumer cases in the wild already, no speculative tech, and I am working on creating a student/teacher dashboard (https://quickthoughts.jgregorymcverry.com/s/1Y7RNB)
(twitter.com/_/status/1108346327665164289)
[stefp] joined the channel
#
[jgmac1106]
[tantek] do you have good resources for doing details and summary correctly for accessibility. The WebAIM articles I keep reading mention bootstrap accordion..
#
[jgmac1106]
I am assuming same rules apply or do screen readers treet details and summary someway automatically?
eli_oat, snarfed, [aaronpk], [kevinmarks], [kimberlyhirsh], [grantcodes], [frank] and [cowglow] joined the channel
#
@rossk
I've been working on an IndieAuth implementation (a shim over AWS Cognito). It's got a ways to go, but it was pretty exciting when I was able to log in to the IndieWeb wiki with it https://indieweb.org/User:Ross.karchner.com
(twitter.com/_/status/1108377259273056261)
iasai and [tantek] joined the channel
#
[tantek]
Jeremycherfas Zegnat I use DOMDocument I’m pretty sure in my /Falcon PHP for accessing/updating my flat files storage
#
Loqi
[tantek]: [grantcodes] left you a message 3 hours, 14 minutes ago: re your photo sizes with mf2 I ended up having to use data elements for my use case, which is slightly different. I know it's not best practice but lets parsers pick up the highest res images. Not tried it with alt attributes yet though
#
[tantek]
Grantcodes yes consider getting alt to work in your setup, I have a feeling it may make you rethink how you publish photos
#
[tantek]
What is details
#
Loqi
It looks like we don't have a page for "details" yet. Would you like to create it? (Or just say "details is ____", a sentence describing the term)
#
[tantek]
[jgmac1106] haven’t found a lot of use for details summary myself, yet
#
[tantek]
Could you start a stub page with your existing IndieWeb use cases for it and example posts that use it?
[grantcodes] joined the channel
#
[grantcodes]
I don't know how much I'd actually want alts on my photos though to be honest, since I almost always publish photos with a name or content that usually describes the image. But my site will handle alts if they are sent via micropub
[chrisaldrich] joined the channel
#
cweiske
no, don't use domdocument
#
cweiske
jeremycherfas, tell me some OPML url you want to parse and the information you need from it
#
cweiske
i'll cook up an example
#
jeremycherfas
Thanks, but here's the thing. I can actually parse the OPML fine, into a multidimensional array. And I can extract the data I want from it. What I am trying to do now is to extract only those elements that have changed since the last time I obtained the OPML.
#
jeremycherfas
And I am nearly, nearly there.
#
jeremycherfas
But I keep getting floored by weird things when looping through arrays, probably because I don't really understand foreach loops.
#
cweiske
are you operating on simplexml elements?
#
jeremycherfas
No. I am just using json_decode on the string previously saved.
#
cweiske
ok. what weird things?
#
jeremycherfas
Let me create a gist.
#
jeremycherfas
Line 5 gives me an error "Invalid argument supplied for foreach()"
#
cweiske
please provide the json file
#
jeremycherfas
I added it to the font of the gist
#
jeremycherfas
If I uncomment line 9 (now) it does exactly what I expect.
#
cweiske
the last item in the json file
#
cweiske
is null
#
jeremycherfas
I also just added the $needle line
#
cweiske
it stumbles on this
#
cweiske
you can't iterate on null
#
jeremycherfas
Huh. I wonder how that got there. Thanks for that. I will go back and look at the code that generates the json.
#
jeremycherfas
I'm also pretty sure that the if() on l.15 is not working the way I want it to, now that I look, because the break just sends it back into the outer loop, whereas I want it to exit both loops.
#
cweiske
because $item does not exist
#
cweiske
you have $new
#
[tantek]
cweiske, I'm curious what problems you have experienced with DOMDocument. I just checked and I've been using it just fine for over 9 years on my site (though perhaps my usage is quite simple).
#
cweiske
for simple tasks, simplexml is much more suited. the domdocument api is much more complicated
#
cweiske
in simplexml you simply do a $doc->path->to->my->tag['attribute']
#
cweiske
and you're done
#
cweiske
just to get to a child element, you either have to manually iterate over childNodes, or use xpath
#
cweiske
and even if you only get one result, you get a nodelist from xpath()
#
cweiske
which means even more iterating
#
cweiske
and fetching attribute values also requires manual iteration over $attributes, until you find the right one
#
[tantek]
yes I have found I have to write a bunch of code to use it
#
cweiske
instead of saying "get me the value for attribute with namx $x
#
[tantek]
I do need XPath though, for extracting various microformats properties when I don't know the exact path-to-my-tag because there is no such exact path
#
cweiske
extracting microformats the prime example for needing domdocument
#
cweiske
while extracting values from "normal" xml with a defined tag structure is easier with simplexml
#
jeremycherfas
Cweiske I don't know how it got there, but array_pop seems to get rid of it.
#
[tantek]
that makes sense! thanks cweiske++
#
Loqi
cweiske has 13 karma in this channel over the last year (22 in all channels)
#
cweiske
jeremycherfas, array_pop always removes the last element
#
cweiske
are you sure you always have a null in there?
#
cweiske
if not, check if the element is an array before iterating on it
#
cweiske
if (!is_array($items) {
#
cweiske
continue;
#
jeremycherfas
Right now, I need to get the more comp[licated part working. And actually, I know for a fact that I will never need the last element, because all I want to do is find the elements before needle is found.
#
jeremycherfas
Ah, right. Could do that.
#
jeremycherfas
Could also, I guess, instead of if() use do while element !=== $needle
[jgmac1106] joined the channel
#
[jgmac1106]
[tantek] yeah will do going to be using it for rubrics, doing a session at IWC New Haven...going to be using nested h-entries and flexbox inside details and summary...right now only place I use it a ton is on my resume...will do a stub after I teah Accra how to get their notes and photos on wiki
#
[tantek]
thanks [jgmac1106], and especially for helping out with Accra! Was going to tweet about all the HWC this week (a record 11! including 10 cities, 3-4 which are new!) but then Twitter unhelpfully suspended my account
jackjamieson and [kevinmarks] joined the channel
#
[kevinmarks]
comparing 2 nested structure in PHP is a bit like this: https://gist.github.com/kevinmarks/b7e6a24d21d1d86634c7ede1ed814ea5
#
[kevinmarks]
You may need to iterate over the new rather than the old though - this is for making sure the new version is a superset of the old
#
cweiske
.. or simply use array_diff
dougbeal|mb1 joined the channel
#
[kevinmarks]
does that behave with nested arrays?
#
[kevinmarks]
OPML can be very nested
#
jeremycherfas
I was having problems with array_diff before, but now I see that might have been because there were null elements. I may go back to that, now that I know.
#
[jgmac1106]
here are the notes...want them to add to wiki....teaching how to sign in ...but I can't remember my password and work is blocking the password reset
#
cweiske
no, kevinmarks is right
iasai, [kimberlyhirsh], chrisaldrich and gRegorLove_ joined the channel
#
jeremycherfas
!tell [kevinmarks] I like your use of $shiny and $legacy, and with your help and cweiske's I may even have solved my problem without needing to compare the arrays. I'm just storing a crucial key value and using that.
#
Loqi
Ok, I'll tell them that when I see them next
#
jeremycherfas
I need to clean everything up though before I can e sure.
snarfed joined the channel
#
jeremycherfas
[kevinmarks]++
#
Loqi
[kevinmarks] has 14 karma in this channel over the last year (39 in all channels)
#
Loqi
Cweiske has 14 karma in this channel over the last year (23 in all channels)
jackjamieson, [eddie], KartikPrabhu, MylesBraithwaite, mattl and [davidmead] joined the channel
#
[davidmead]
This maybe a silly question but, if I add a field into a Known plugin, do I have somehow add it in the DB structure separately? Or does it it get added automatically when it’s used?
jimpick, [tantek], jackjami_, [Rose], barpthewire, [schmarty], gRegorLove_, [kevinmarks], KartikPrabhu, snarfed, iasai, [jgmac1106], [pfefferle], dougbeal|mb1 and [aaronpk] joined the channel