Last active
November 24, 2021 16:01
-
-
Save scripting/8e0b74bc144e88ab6c38e6d0be3ab049 to your computer and use it in GitHub Desktop.
A script that generates the current list of Drumkit verbs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Changes | |
//11/23/2021 by DW | |
//Updated to handle a subcategory of verbs, such as op.attributes. | |
//11/22/2021 by DW | |
//http://drummer.scripting.com/davewiner/verblist.opml | |
var theOutline = { | |
opml: { | |
head: { | |
title: "Drumkit verb list", | |
dateCreated: "Mon, 22 Nov 2021 21:49:22 GMT", | |
dateModified: new Date ().toUTCString (), | |
urlPublic: "http://drummer.scripting.com/davewiner/verblist.opml", | |
urlUpdateSocket: "ws://drummer.scripting.com:1232/" | |
}, | |
body: { | |
subs: [] | |
} | |
} | |
}; | |
function addVerbToCat (theCat, verbname) { | |
theCat.subs.push ({ | |
text: verbname | |
}); | |
} | |
function addCat (theCatStruct, theCatName) { | |
var thisCat = { | |
text: theCatName, | |
subs: [] | |
}; | |
theOutline.opml.body.subs.push (thisCat); | |
for (var x in theCatStruct) { | |
if (typeof theCatStruct [x] == "function") { | |
addVerbToCat (thisCat, theCatName + "." + x) | |
console.log (x) | |
} | |
else { | |
var subcat = theCatStruct [x]; | |
for (var y in subcat) { | |
addVerbToCat (thisCat, theCatName + "." + x + "." + y) | |
console.log (x + "." + y) | |
} | |
} | |
} | |
return (thisCat); | |
} | |
addCat (op, "op"); | |
addCat (clock, "clock"); | |
addCat (date, "date"); | |
addCat (dialog, "dialog"); | |
addCat (dns, "dns"); | |
addCat (drummer, "drummer"); | |
addCat (file, "file"); | |
addCat (github, "github"); | |
addCat (oldSchool, "oldSchool"); | |
addCat (opml, "opml"); | |
addCat (base64, "base64"); | |
addCat (rss, "rss"); | |
addCat (speaker, "speaker"); | |
addCat (string, "string"); | |
addCat (tab, "tab"); | |
addCat (twitter, "twitter"); | |
addCat (webBrowser, "webBrowser"); | |
console.log (opml.stringify (theOutline)); | |
file.writeWholeFile ("verblist.opml", opml.stringify (theOutline)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment