Reading LiveCode

We look at source code for a Transport Plugin service that converts an Audioboom url to a wiki page with five items of four types and a complete journal. github

Transport Plugin

github

See Audioboom Transport

Audioboom Transport

Compare Audioboom to Utopia Studios: 04

Audioboom

Utopia Studios: 04

We identify functions in the source and create folds here by the same name. Then we start reading from the bottom filling in notes for functions as we read them.

Register index as the only service endpoint so far.

Using the easyjson library.

This recording was made near London, by fortyfoxes, on Dec 15, 2014 at 9:18 AM - audioboom

London

fortyfoxes

audioboom

Extract id from url.

Fetch clip json.

Extract audio clip array.

Construct audioboom page array.

Return json from array.

Construct story audio array, etc.

Page array add to end.

Commands to add a constructed item to the story and the journal. Called from page array add to end.

Extract fields of audio clip array.

Construct new page array.

Add paragraph to page array.

Construct image div.

Add html to page array.

Add audio to page array.

Construct open street map description.

Add map to page array.

Construct user paragraph.

Add paragraph to page array.

Set page title.

Add paragraph to page array.

Construct journal array.

Add to end of index array.

Add to journal array.

Extract dropped url from $_POST_RAW.

Generate some json with guess clip json.

Output headers and some json.

I was impressed that the service transported complete wiki pages, modeled after similar Audioboom pages, ready to be forked into their new destination. I had expected a page of boiler plate with one audio item to be copied elsewhere.

I was surprised that the page included a complete journal. Adding factories and then editing them to the desired item creates more journal than required. However adds do require unfortunate logic to create a sequence since the default placement is at the beginning of the story. github

github

Some call paths seem out of order. Add paragraph to page array could be a late addition as the internal complexity of the journal surfaced in the design.

I've invested two hours reading and now understand the LiveCode abstractions as applied to transporting. The functions have been systematically named and easily converted to my own notes as you see here.

Tip: Open the last revision of this page. Then shift-hover over each action below to see my approach to reading and appreciating an unfamiliar program in a long forgotten language. Serious reading starts about halfway through the journal.