#microformats 2024-06-11

2024-06-11 UTC
[fluffy], {{lifeofpablo}}, barnaby, [snarfed], eitilt, to2ds, barnabywalters, Loqi, [KevinMarks], Guest6 and robalex joined the channel
#
robalex
Question about rel-me and Mastodon link verification. I noticed hachyderm was having verified accounts link to this page, which has a rel=me for each approved profile.
#
robalex
I think identity consolidation would cause each of the mastodon profiles to be treated as having a common identity, but these are clearly different corporations. Am I understanding rel-me identity consolidation correctly?
#
robalex
(I've been writing a rel-me crawler and found a bunch of mastodon accounts grouped because of this page)
#
[snarfed]
huh, odd. looks like that page on the web is https://community.hachyderm.io/approved/
#
[snarfed]
you're right, that seems like wrong usage. rel=me means "this is me," not "this is someone else that I've 'approved' somehow"
#
aaronpk
aren't they using that page to get the mastodon checkmark?
#
aaronpk
Unfortunate overloading I guess?
barnaby joined the channel
#
[KevinMarks]
They should give them each their own profile page. There were other mastodon verification services that did that (eg for journalists)
barnaby joined the channel
#
[tantek]
Thought we had an FAQ on that, as in, don't do that
#
[tantek]
or rather, if you do that, then you'll all claim to be the same person, which is probably not what you or they want
robalex joined the channel
#
robalex
thanks!
[mattl] and [jacky] joined the channel
#
[tantek]
robalex++ thank you for the heads-up and welcome!
#
Loqi
robalex has 1 karma over the last year
gRegor and [Al_Abut] joined the channel
#
[snarfed]
[tantek] (from #indieweb-dev) sure! when I enter https://snarfed.org/ into the form on https://h2vx.com/vcf/ and click Download, the POST to /vcf/get-contact.php 500s
#
[tantek]
got it. Can't help but wonder if something broke with the host auto-upgrade to PHP 8
#
[tantek]
confirmed. can you file an issue so I don't forget? it may take me a while to get to 😕 https://github.com/microformats/h2vx.com/issues
#
[tantek]
also if there's anything obvious in the source that would break in PHP8, I'm open to suggestions
#
Loqi
[preview] [snarfed] #8 VCF converter crashes on some input sites
#
gRegor
Nothing jumps out in the source to me, though I have some recollection of needing to tweak CASSIS for PHP8 in another project, maybe it was the this-week newsletter code. Does that ring a bell, aaronpk?
#
gRegor
So maybe the cassis on h2vx needs to be updated
#
gRegor
common.php includes cassis.js
#
[Joe_Crawford]
I see a fair number of presumptions of http vs https that might be tripping points
#
[tantek]
interesting. I supposed the nice thing about being stuck in 500 land is live fix attempts are unlikely to make it worse
#
gRegor
get-contact.php is checking for http or https, though only in lowercase. Wouldn't cause a 500, though.
#
[Joe_Crawford]
Is the `tidy` class available to php?
#
gRegor
Good q, if that was a mod in the previous PHP version might not have carried over
#
[tantek]
I think I had to ask for the tidy extension to be installed previously
#
[tantek]
wow ok it has been a while since I touched this code
#
[Joe_Crawford]
made it work. making a PR
#
[tantek]
wow wat
#
[tantek]
and I had just confirmed that tidy *is* installed
#
[tantek]
PHP Version 8.1.27
#
[Joe_Crawford]
yeah, my local install of 8 has it too. I had no idea tidy was hidden in amongst the php code.
#
[Joe_Crawford]
PHP'S GOT EVERYTHING
#
[Joe_Crawford]
and let me say times like these I'm so happy I can do `php -S 127.0.0.1:8000` to run a webserver. It's still magic to me.
#
[tantek]
yup that makes sense [Joe_Crawford]. that cassis.php is I'm assuming the latest version from the CASSIS repo, whereas the old cassis.js in the site is from 2010!
#
[Joe_Crawford]
Derp. No. I removed cassis.js from the php side. Just made a php file and did a require on it.
#
[Joe_Crawford]
I have no illusions it's what you *want* to happen. But my brain is *make it do the thing* not _let's preserve the intent_
#
[Joe_Crawford]
`ob_start();`
#
[Joe_Crawford]
`include 'cassis.js';`
#
[Joe_Crawford]
`ob_end_clean();` -- no longer does what it once did. maybe it should be `require` or `require_once` ? no idear
#
[tantek]
oh? did that change in a non-backward compatible way?
#
[Joe_Crawford]
the ob_start and get clean is about buffering output
#
[Joe_Crawford]
I'd want to see what your php error logs showed
#
[Joe_Crawford]
https://www.php.net/manual/en/function.include.php `include()` ought to parse whatever is passed as php. But for some reason it didn't work.
#
[tantek]
yes the ob_start and ob_end_clean is about making sure bits of cassis.js don't end up in the PHP output by accident
#
[tantek]
hence the buffering / cleaning
#
[tantek]
looks like I don't even have a local copy to install on this current laptop, that's how long it's been since I've touched the site
#
[tantek]
[Joe_Crawford] when you say you "Just made a php file", is that not the cassis.php from https://github.com/tantek/cassis/blob/main/cassis.php ?
#
[Joe_Crawford]
no I copied cassis.js into cassis.php
#
[Joe_Crawford]
I also removed anything that was bare html that might output. Just plopped in a `<?php`
#
gRegor
Nothing should have changed about output buffering in PHP8 afaik
#
[Joe_Crawford]
_`/* if you see this in the browser, you need to wrap your include of cassis.js with calls to ob_start and ob_end_clean, e.g. use the following in your PHP: ob_start(); include 'cassis.js'; ob_end_clean(); <?php`_
#
[Joe_Crawford]
It amazes me that that could work
#
[tantek]
I'd rather use the cassis.php in the repo instead of one that's one-time hand constructed
#
[tantek]
"amazes me that that could work" <- why? it's literally what my site's been doing with its inclusion of cassis in the server-side PHP code
#
gRegor
I thought the cassis.php was compiled from the .js, didn't aaronpk add that at some point?
#
[tantek]
gRegor yes that's my point
#
[Joe_Crawford]
Because I don't think like you Tantek. 🙂 To me, a file ought to be either a JS file or a PHP file or I get dizzy.
#
[tantek]
that's the version checked into GH that I linked to
#
[Joe_Crawford]
But I'm glad it worked! 🙂
#
[tantek]
[Joe_Crawford] I'm lazy and I like simpler things, like fewer files
#
gRegor
lesscode++
#
Loqi
lesscode has 1 karma over the last year
#
[Joe_Crawford]
I appreciate the linguistic novelty.
#
[tantek]
more than novelty, it's helped me write less code
#
[tantek]
basically, any "business logic" or computation, string manipulation, form validation etc. can be done that way
#
[Joe_Crawford]
```function string($n) {
#
[Joe_Crawford]
if (js()) {
#
[Joe_Crawford]
if (typeof($n)=="number")
#
[Joe_Crawford]
return Number($n).toString();
#
[Joe_Crawford]
else if (typeof($n)=="undefined")
#
[Joe_Crawford]
return "";
#
[Joe_Crawford]
else return $n.toString();
#
[Joe_Crawford]
}
#
[Joe_Crawford]
else { return "" . $n; }
#
[Joe_Crawford]
}```
#
[Joe_Crawford]
Let's add Perl support while we're in there.
#
[tantek]
yeah, I prefer the more succinct PHP functions as opposed to the wordier camelCase JS ugly names
#
[tantek]
Perl's syntax is too incompatible
#
gRegor
Schrödinger's code :)
#
[Joe_Crawford]
[tantek] Added a commit to my PR to pull from Cassis v0.1
#
[Joe_Crawford]
cut and paste, that is
#
[Joe_Crawford]
I *do* like the idea of creating, say, an Interface that 2 files in different languages ought to adhere to. I think a foo.js and a foo.php (and a foo.pl!) that all referenced a common file that defined what public functions classes and methods ought to exist in there might be neat. Heck, might already exist.