(2022-03-17) TwinPages widget for other sites

TwinPages is delivered through a JavaScript widget, so once I add a site/space to my SisterSites db, it should be able to display TwinPages fine.

This is working for Phil Jones.

Neil Mather has issues with no using SSL - (2022-02-11) Moving TwinPages to FluxGarden

Mike Travers has a different broken-widget issue.

First - have to get local WikiGraph server running (web.py!), then my local FluxGarden template calling that server.

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 sqlite instead of 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, bool(r_space)=True
  • change db space record again so there will be no match
    • type(r_space) = instance but now bool(r_space)=False
    • 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.js works for me

Edited:    |       |    Search Twitter for discussion