kimberlyhirsh[d], KartikPrabhu, [snarfed], alex11, [tantek], [jgmac1106], moose333, [jeremycherfas]1, capjamesg, angelo and hendursa1 joined the channel
#petermolnarparsing HTML with regex is fun though, because it's one of the simplest ways to summon a Lovecraftian Outer God
#ZegnatIn the case of JSON-LD, it might be safe enough though. As you are not really looking to parse HTML per se. Just looking for a JSON blob delimited with <script> and </script> strings?
alex_ joined the channel
#petermolnarthat is not that simple though in my opnion. One is supposed to add `type="application/ld+json"` with that `<script>` but what if the json block is inside ordinary javascript?
capjamesg joined the channel
#petermolnarin theory one could get all <script(?:[^>]+)>(.*)</script>, but then what?
#Zegnat"if the json block is inside ordinary javascript" then it is not a JSON-LD island. So when you grab the script tags, you can run whatever is inbetween them through a JSON parser, and if that does not work, it was not a valid JSON-LD island.
#ZegnatSure you could add the type attribute for the string match. I am just saying string matches might actually be completely fine if all you want is JSON-LD islands and are not at all interested in the fact that it happens to be HTML they are inside of :)
#petermolnarthe world should have stuck to XML; that way we'd have a single data exchange format, and not multiple of them embedded in eachother.
#[tantek]petermolnar, at least they're not publishing data in CSS syntax 🙂
#capjamesgI am using extruct for json-ld parsing for a side project.
#[tantek]I kinda wonder if that could also be part of an authoring UI, like providing a bit of reply-context heads-up (author, date of original) when you're composing a reply
#[tantek]or even a warning the way that Guardian articles provide warnings about how old an article is if it's more than a year old
#Murray[d]I really like the idea of a warning about responding to something over a certain age; I know some forums used to show a warning if you responded to a thread over a preset age (it had a term to do with graves or tombstones that I cannot recall now...)