Has anyone used the Random Dog Method?

I was intrigued by the tw.com/RandomDog demo.

I see some posts about http-requests. Though they are above my pay grade; the tech side I don’'t understand; the results I do.

Anyhow, here is the question …

Q: How could one setup a simple service to provide a link to a Random TiddlyWiki daily??

Just a query,
TT

In the early days of websites, with weak search engins, we used to join a loop of links. Each site would be linked to, and link to another. One could follow the links to review all in the loop. If done in a standard way you could automate walking the loop and collect all the websites in it. Once you have the list, however you get it you can generate random links to one of them.

Okay.

So what I was thinking of was a gadget like RandomDog you could install in a wiki. And. Once a day, get a link to another wiki.
I’m hazy how that would work.

(I know nothing about servers.)

TT

That’s the core of the problem. To get a random link to another wiki, there needs to be a full list of all possible links, from which that random is chosen.

In the case of random dog, the random dog website has all the random dogs, and you ask if to select a random one for you.

In the more general case here, you either need one of the following:

  • the same - someone else to have a list of all options and provide one at random when you request
  • someone else have a list of all options, which you obtain, and then you choose one at random from that provided list
  • some method to generate the list of all options when needed

From the point of view of the code you add to your local TW, the above is in order from simplest to most complex. But “simplest” means you’re offloading the complexity to a server elsewhere which does some of the work instead.

So the question becomes - is there an existing list of wikis that can be obtained?

If it’s just a random tiddlyhost link, then some parsing of the output of https://tiddlyhost.com/explore?s=r to get the top link would work. If tiddlyhost has the same in an API then even better.

(parsing that output in wikicode is beyond me. In my native linux bash scripting, it’s trivial though fragile: curl -s "https://tiddlyhost.com/explore?s=r" | awk -F'"' '/a target/ {print $4}' | head -n 1