Sure. For the whole extraction process - that relied on some custom scripts that AI helped with. I would say it depends on the data.
I will however share the two buttons I made.
Tell me a joke
This relies on @saqimtiaz’s shuffle operator, which should be added separately.
<$button tooltip="Get a random joke tiddler" class=<<tv-config-toolbar-class>> >
😄
<$action-navigate $to={{{[tag[$:/jokes]_shuffle[]last[]]}}} />
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text="tell me a joke" />
</span>
</$list>
</$button>
Add a joke
First, import my alphaNumericGenerator.js
as a separate tiddler:
/*\
title: alphaNumericGenerator
type: application/javascript
module-type: macro
Generate an alphanumeric string of 10 to 12 characters
\*/
(function(){
"use strict";
exports.name = "alphaNumericGenerator";
exports.params = {};
exports.run = function alphaNumericGenerator() {
return Math.random().toString(36).slice(2).toUpperCase() // uppercase so there are no distracting humps in the title
};
})();
Then, the button:
<$button tooltip="Create new joke tiddler" class=<<tv-config-toolbar-class>> >
😄
<$action-sendmessage $message="tm-new-tiddler" title=`$:/Jokes/$(alphaNumericGenerator)$` tags="$:/jokes" source="Daily HaHa’s" />
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text="add joke" />
</span>
</$list>
</$button>
By the way, the buttons have these two tags $:/tags/Actions
and $:/tags/PageControls
.
I might change to a proper icon once TW switches to Lucide icons, but the emoji will do for now! It would bother me more if they didn’t happen to be on a new line. These buttons are smaller than normal buttons by the fact they have an emoji instead of a TW-format icon.