Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / config.json
Last active Jul 26, 2021
A config.json file that serves files without extensions as markdown.
View config.json
{
"defaultExtension": "md"
}
@scripting
scripting / config.json
Created Jul 25, 2021
An example config.json for use with PagePark
View config.json
{
"defaultExtension": "opml",
"mirrors": {
"/": "http://hosting.opml.org/dave/spec/states.opml"
}
}
@scripting
scripting / scriptingIncludes.opml
Last active Jul 16, 2021
An example outline for a Scripting News blog post
View scriptingIncludes.opml
<?xml version="1.0"?>
<opml version="2.0">
<head>
<title>scriptingIncludes</title>
<dateCreated>Fri, 16 Jul 2021 15:33:52 GMT</dateCreated>
<dateModified>Fri, 16 Jul 2021 15:36:16 GMT</dateModified>
<ownerTwitterScreenName>davewiner</ownerTwitterScreenName>
<ownerName>Dave Winer</ownerName>
<ownerId>http://twitter.com/davewiner</ownerId>
<ownerEmail>dave.winer@gmail.com</ownerEmail>
@scripting
scripting / ioGlue.ftsc
Created Jun 28, 2021
Script to run in UserLand Frontier or the OPML Editor to create instantoutliner glue
View ioGlue.ftsc
on createInstantOutlineGlue () {
local (apiUrl = "http://instantoutliner.com/createglue?", flfirst = true);
on pushparam (name, val) {
if not flfirst {
apiUrl = apiUrl + "&";};
apiUrl = apiUrl + name + "=" + string.urlencode (val);;
flfirst = false;
flfirst = false;};
pushparam ("url", "https://raw.githubusercontent.com/scripting/instantOutlines/main/outlines/scripting.opml");;
pushparam ("title", "Scripting News");;
@scripting
scripting / githubResponse.json
Created Jun 25, 2021
This is what GitHub sends back when you upload a file via the API.
View githubResponse.json
{
"content": {
"name": "now.txt",
"path": "misc/now.txt",
"sha": "ca4b31cc6e4a401ce43f78d94dd1e2b0f462c633",
"size": 11,
"url": "https://api.github.com/repos/scripting/instantOutlines/contents/misc/now.txt?ref=main",
"html_url": "https://github.com/scripting/instantOutlines/blob/main/misc/now.txt",
"git_url": "https://api.github.com/repos/scripting/instantOutlines/git/blobs/ca4b31cc6e4a401ce43f78d94dd1e2b0f462c633",
"download_url": "https://raw.githubusercontent.com/scripting/instantOutlines/main/misc/now.txt",
View config.json
{
"github": {
"username": "scripting",
"repo": "instantOutlines",
"repoPath": "",
"password": "xxx",
"committer": {
"name": "Bull Mancuso",
"email": "bull@mancuso.com"
},
@scripting
scripting / config.json
Created Jun 22, 2021
A config.json file for PagePark that's used to test the mirrors feature.
View config.json
{
"mirrors": {
"/test.opml": "http://scripting.com/publicfolder/pageparkTestFiles/rssjs.opml",
"/test.jpg": "http://scripting.com/publicfolder/pageparkTestFiles/peach.jpg",
"/test.png": "http://scripting.com/publicfolder/pageparkTestFiles/tree.png",
"/test.xml": "http://scripting.com/publicfolder/pageparkTestFiles/davetwitterfeed.xml",
"/test.json": "http://scripting.com/publicfolder/pageparkTestFiles/wodemo.json",
"/test.txt": "http://scripting.com/publicfolder/pageparkTestFiles/applejoke.txt",
"/test.md": "http://scripting.com/publicfolder/pageparkTestFiles/test.md"
}
@scripting
scripting / earlyTwitterUsers.js
Created Apr 9, 2021
A script that runs in the Drummer environment, and uses the Twitter verbs to find the names of the earliest Twitter users, starting with @jack.
View earlyTwitterUsers.js
var flfirst = true;
op.insert ("Early Twitter signups", down);
for (var i = 12; i < 25; i++) {
op.insert (twitter.getScreenname (i), (flfirst) ? "right" : "down");
flfirst = false;
}
op.go (left, 1);
View gluescript.js
makeFilePublic: function (path) {
return new Promise (function (resolve, reject) {
servercall ("makefilepublic", {relpath: path}, true, function (err, data) {
if (err) {
reject (err);
}
else {
resolve (data.url);
}
});
@scripting
scripting / listChangedProjects.ftsc
Last active Jan 17, 2021
I needed a script to loop over a calendar-structured folder to generate a list of the most recent updates to a set of projects that are backed up in these folders. I used Frontier. Here's the script.
View listChangedProjects.ftsc
on listChangedProjects (whenStart, whenEnd) {
«Changes
«1/16/21; 10:36:01 AM by DW
«Created. Generates a table with the names of the most recent version of each of the projects that
were edited in the period we're looking at. whenStart is the day we start our search, whenEnd is
when we stop searching. We go back in time, so whenStart must be more recent than whenEnd.
local (basefolder = nodeEditorSuite.getFolder () + "backups:");
local (destfolder = "Marin:changedProjects:");
local (when = whenStart, adrtable = @scratchpad.changedProjects);
new (tabletype, adrtable);