I know nothing of karate beyond what I have seen in movies, but I would guess that one of the philosophies behind it is “simpler = better”.
My karate non-knowledge did not stop me from using the metaphor in a post where I thought I was being clever to using some Google Spreadsheets to extract opengraph meta data from Kaltura video URLs (to get the direct link to the video’s mp4, which I noted was buried in the page’s opengraph metadata).
I went to use it last week to help a project participant for in the H5P / PB Kitchen. The problem was my reliance in the first spreadsheet on a third party site https://opengraphcheck.com/ that I had found could take a URL and return as results the opengraph tags. That site seems DOA, so all my formulas broke.
Thus, in about 15 minutes of sleeve rolling, web searching on “Xpath google sheets opengraph” (got an assist from this blog I was leaving out the single quotes on the property name), I got it done more directly.
For anyone who cares, the original spreadsheet was updated, so you can just get a new copy (toss the first one), and get back to extracting Kaltura video mp4 links that the display pages themselves do not provide (this is all about using Kaltura in the H5P Interactive Video content type).
And for reference, the initial function that broke (it references the named cell that contains the URL for a Kaltura Video) looked like:
= IMPORTXML("https://opengraphcheck.com/result.php? url="&ENCODEURL(kaltura_url),"//table/tbody/tr")
Which of course died when https://opengraphcheck.com/ went offline or wherever dead websites go. This is the much cleaner function, that does it directly:
Simpler, in Xpath queries, is a better move. Apologies to anyone who used that first spreadsheet, I am embarrassed by the lame approach I took.