Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / config.json
Created July 25, 2021 16:24
An example config.json for use with PagePark
{
"defaultExtension": "opml",
"mirrors": {
"/": "http://hosting.opml.org/dave/spec/states.opml"
}
}
@scripting
scripting / scriptingIncludes.opml
Last active July 16, 2021 17:03
An example outline for a Scripting News blog post
<?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 June 28, 2021 19:11
Script to run in UserLand Frontier or the OPML Editor to create instantoutliner glue
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 June 25, 2021 14:28
This is what GitHub sends back when you upload a file via the API.
{
"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",
{
"github": {
"username": "scripting",
"repo": "instantOutlines",
"repoPath": "",
"password": "xxx",
"committer": {
"name": "Bull Mancuso",
"email": "bull@mancuso.com"
},
@scripting
scripting / config.json
Created June 22, 2021 18:45
A config.json file for PagePark that's used to test the mirrors feature.
{
"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 April 9, 2021 14:13
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.
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);
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 January 17, 2021 12:14
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.
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);