(2022-03-17) TwinPages widget for other sites
This is working for Phil Jones.
Mike Travers has a different broken-widget issue.
Then hit a local-FluxGarden page - ah, now seeing things break.
- ah, db of spaces has my live pattern instead of local pattern
- oops before I fix that data, I should fix the code to handle the failure better!
- logging is breaking things, check type/value of a variable, turns out to be
IterBetter, in looking at that re-discover that I'm hitting
psql, so add that log line...
- decide to start back from Mike's screenshot - he's getting that same debug/log concat error, but he's trying a variety of Referers using curl.
- ok, let's start from basics
- return simple text if Referer is null - done
- launch SQLite, update local space-name in db.
- hit local DiamondAge, get nice "No twinpages!" result in that box! Ah, there really is no (other) site in that local db with that page... try local AlanKay, and get nice result!
- conclusion: the happy path works ok
type(r_space) = instance,
- change db space record again so there will be no match
type(r_space) = instancebut now
- derp I was just calling
web.internalerror()instead of returning it
- nope that doesn't work either, going to change how I handle error cases
- ok, I think I have things refactored so that bad-submits get a readable specific message instead of a stacktrace. But will wait to deploy tomorrow (after diff-ing against production to find any surprises).
- related: Melanocarpa/Timur Ismagilov doesn't like the Safari-cross-domain issue, so wants to do some coding on his own server, so I have him just hitting the same JS endpoint (from his server code), passing the Referer.
Mar18: deployed the code, alerted couple people that it's there to try hitting.
- this works for me:
curl -H Referer:http://www.hyperphor.com/ammdi/logseq http://www.wikigraph.net/twinpages.js
- Mike reports it works, as long as his page-url has no punctuation. Ah, same issue I had to clean up by hand when building the database.
- deployed →
curl -H Referer:http://www.hyperphor.com/ammdi/Alan-Kay http://www.wikigraph.net/twinpages.jsworks for me