Random Generator of Random Generators (but really the folly of tools)

The audience who appreciates a subtle reference to recursion, a machine that makes machines, or going meta about something meta is sized down there maybe in the single digits… of one hand. Oh well, if anything I write to amuse myself.

Insert laughter.

So speaking of turning on a machine of productivity, Martin Weller is blogging portions of ideas that will be out sometime soon as a new book. But it’s on metaphors (which I love and over indulge in myself) and the tea leaves suggest it will make use of a movie where nothing much happens.

He recently shared a fun EdTech Pitch Generator (try it) which has a few of my paw prints on it. About two years ago Martin tweeted for suggestions to create a random EdTech generator. Randomness in web content is one of my cornerstones! By the time I got to digging through some examples, Martin had already fashioned one by remixing a rather elegant version he found on glitch.

Over breakfast one day I created a version available on GitHub, which I think is a bit prettier! and have added a few bits to it since (like a tweet it button). See the torrid tale (which includes the small internet world bit of a google image search for a background image handed me one by my pal Michael Coghlan, hi Michael!)

This is all way too much pre-amble to say the Twitter recently nudged me that Martin had created a new one that generates EdTech Pitches with the play on tired industry metaphors. It’s fun, right?

It does make me happy to see Martin continue to play these out. A few others have made it their own too, including one in German by Nele Hirsch.

But that squeaky wheel in my head started turning and there was an itch to scratch. Some of it is wondering about once you have amused yourself generating these, maybe tweeting a screen shot, what really is the use?

So I decided to add a few more examples, all of which are included as stand alone HTML in sub directories of the original repo.

First up is a generator that plays with the different versions of this code, can you see the meta-recursion? Probably not.

I was happy to see I could include HTML links in my arrays of random items and have them work:

Ah, but this messed up when I tried the function that let’ you tweet it, so a tweet had all that gunky HTML in it. Yuck.

Down the StackExchange rabbit hole I went, trying to find a solution to extract the link text and url. I cobbled together a bit of a function that looks for a match of an HTML anchor link, like <a href="http://metaphor.edtechie.net/" target="_blank">Open Education by Metaphors (featuring Telio!)</a> and replaces it with Open Education by Metaphors (featuring Telio!) http://metaphor.edtechie.net/

// Replaces an HTML href with the link text followed by URL 
	// to make tweetable for array elements that have links in them
	function href2text(str) {
		// pattern for matching href
		let regexpHref = /]+href=\"(.*?)\"[^>]*>(.*?)/gi;
		
		// get matches
		let match = regexpHref.exec(str);
		
		if (match) {
			// get the replacement
			do {
				 replacement = `${match[2]} ${match[1]}`;
			} while((match = regexpHref.exec(str)) !== null);

		   // replace the match string with the replacement
			return( str.replace(regexpHref, replacement));
		} else {
			return (str);
		}
	}

It’s probably clumsy and others will point out what it misses, but hey, it worked for me, and I learned something in the process.

Then I thought about trying something that might have some more relevance. There is nothing highly original about a web site that generates prompts for creative acts, but here’s my take on it:

Okay, maybe not the best, but you do get some weird stones in the machine with randomness. It’s more about the idea– when might you need a tool that can maybe cast an assignment or a task into something that is not just one way to go about it? Instead of just giving learners one exact assignment they can get options to achieve the same result but with a bit more variety in the tasks.

So putting on my H5P Kitchen top hat I thought next about a generator to suggest starting with a link to an existing H5P and providing a suggestion as a task for how to remix it (more or less a redo of the DS106 Assignment Remixer which really was the idea I borrowed from Tom Woodward).

Remix yourself something to try in H5P:

These last two can certainly use some more variety in them. The more you provide options and ways to change up the remixer, the better.

And that is the difference between taking my code, modifying it, and hoisting it on your site (which is quite fine). Only you can change it.

But as hosted in GitHub, you could actually (create an account) log in, and make a modification suggestion to the versions I made. Yes, go run and hide from the complexity of this. Once I say GitHub, my audience has dropped off to 0.00001. But this is a powerful concept- educators talk about creating ways for students to contribute to something public as open pedagogy, but there sure is a lot more to do then writing chapters for a Pressbook or editing a WikiPedia article (all are fine).

Walk with me through some code, fear it not, starting at the index.html file in GitHub for the Creation Machine. Open it up, Breathe deeply. It’s only HTML. When you click the pencil icon, if you are logged into GitHub you will be prompted to make a copy. That’s okay. This is your working copy.

Scroll down to line 123. This is the first set of random things- the creative prompts, each one in single quotes, each separated by a comma.

// arrays of acts of creativity 
  	   let creative = [
  	   	'Write a Haiku',
  	   	'Draw with a crayon',
  	   	'Film a TV commercial',
  	   	'Make a collage',
  	   	'Make a comic strip',
  	   	'Write a sonnet',
  	   	'Create an acrostic poem',
  	   	'Write a tweet length tale',
  	   	'Sing a ballad',
  	   	'Write a limmerick',
  	   	'Record a love song',
  	   	'Develop a French dialogue',
  	   	'Pitch a TV game show',
  	   	'Develop an action film plot'
  	   
  	   ];

So think of something one new to do like maybe ‘Make an animated GIF’ or ‘Create a Meme Image’. Just enter a carriage return after any existing element (after the comma), and add it to the mix.

There’s more- arrays (that’s what these are) for Character 1 and Character 2. Add more interesting people (or heck, fix my typos)!

// one character
  	   let character1 = [
			'a lonely martian',
			'William Shakespeare',
			'Wilma Flintstone',
			'Kamala Harris',
			'Lisa Simpson',
			'your weird uncle Mel',
			'Katniss Everdeen',
			'a Grasshopper',
			'Hermione Granger',
			'Doc Brown',
			'Lassie',
			'Moses',
			'Confuscius',
			'Ada Lovelace',
			'Eeyore',
			'Abraham Lincoln',
			'Elvis Presley',
			'Harry Houdini',
			'Ghengis Kham',
			'Bob Dylan',
			'a potato',
			'Lady Gaga'
			];

There’s more- a set of places and also an action as to what might happen here.

Now we get to the brilliance of this generator, and why I owe Martin so much for pointing me to the original. Most of the ones I have made (like Make a MOOC or Zach Wahlen’s twitter bot spreadsheet) used than have a sentence that inserts a random element from each hopefully in a way that makes sense.

But every sentence looks the same, so you can easily see the pattern. My generator uses what I discovered in the original glitch version (I think this is it) is a clever approach to adding a second level of remix– you create a variety of sentences that use the random array elements in different ways.

This is where it gets crazy, the sentences need to be enclosed n back tick characters, not single quotes, because they contain variable references.

/* create different ways of outputting a combination of arrays above.   
	   Each element includes all of the text in backticks (not single quotes!)
	   and use the structure ${arrayname[random(arrayname)]} to insert a random
	   item from a specified array.
	   
	   The more you add here the more varied will be the responses.
	*/
	  
	  let options = [
		`${creative[random(creative)]} where ${character1[random(character1)]} 
                  and ${character2[random(character2)]} somehow end up at \ 
                  ${places[random(places)]} where they ${actions[random(actions)]}.`, 
		`${creative[random(creative)]} that has ${character2[random(character2)]} go 
                  to ${places[random(places)]} only to find waiting there is 
                  ${character1[random(character1)]}. They decide to 
                  ${actions[random(actions)]}.`,
		`${creative[random(creative)]} where ${character2[random(character2)]} 
                  falls in love with ${character1[random(character1)]} 
                  while at ${places[random(places)]}.`,
		`${creative[random(creative)]} for that time ${character2[random(character2)]} 
                   went to ${places[random(places)]} only to discover to get home 
                   they had to ${actions[random(actions)]}.`,
		`${creative[random(creative)]} that takes place at ${places[random(places)]} 
                   and pits ${character1[random(character1)]} against 
                   ${character2[random(character2)]} in a contest to  \ 
                   ${actions[random(actions)]}.`
		];

I am sure I lost everyone now, but to me this is beautiful because as you add more differently structured sentences they less the pattern appears obvious to the viewer. Even if it is making up nonsense, it feels like more random nonsense.

Anyhow, this is really how I find amusement and interest these days, making small things with my limited set of tech skills and a sense of how to look for answers to things I don’t know how to do.

Which brings me back to a bit of tool folly.

The pursuit of grails and magic solutions is what lands us in LMS and Teams and Slack jail cells. And I find hardly any of these top tools things I would say are going to help me in content creation.

The important elements that are missing when you sip from the shiny grail cups is a conceptual understanding (not full) of how it works. If I never even open the hood on my car, I am reliant on a dashboard and a service dealer to help with issues. I do not need to be a mechanic, but some basic understanding of engines, oils, batteries, belts, fluids goes a long way.

The same goes for making digital content. Top Tools only let you do what they were designed for. I find it more useful to have an understanding of the granular elements of digital content. How to manipulate images. How to optimize them in reasonable file sizes. How to edit audio, video. How to fix HTML, or maybe even dabble in a little JavaScript, jQuery.

Grails are the wrong place to look.

To really be in this game, you have to pop the hood and get in the engine. Search for answers. Try and break things.

I of course will never believe I can convince masses to come around to my ways. That’s okay. I know I can work stuff. It’s the craft, not the tools, and after almost 30 years now in this EdTech game all I see is a desire for tools over craft.


Featured Image: One cannot date themselves as an EdTech old fogie more than invoking Second Life. It’s easy to make fun of, but I learned more there than I wasted time. Like here where I was going meta with my avatar self (you might have to read the caption to understand) (that is if anyone really made it to the end of this post) (hi)

That Old Barbershop Mirror Effect in Second Life
That Old Barbershop Mirror Effect in Second Life flickr photo by cogdogblog shared into the public domain using Creative Commons Public Domain Dedication (CC0)