Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
const folder = "/root/Dropbox/Miami/littleoutliner/publicFiles/users/";
var url = options.httpRequest.url;
var splits = url.split ("?");
url = splits [0];
splits = url.split ("/");
var username = splits [1], fname = splits [2];
if ((username === undefined) || (fname === undefined)) { //tell pagePark we're not handling it
callback (undefined, {flNotHandled: true});
}
const folder = "/root/Dropbox/Miami/littleoutliner/publicFiles/users/";
var url = options.httpRequest.url;
var splits = url.split ("?");
url = splits [0];
splits = url.split ("/");
var username = splits [1], fname = splits [2];
if ((username === undefined) || (fname === undefined)) { //tell pagePark we're not handling it
callback (undefined, {flNotHandled: true});
}
@scripting
scripting / oldSchoolGeneratedHtml.html
Created November 4, 2020 15:42
An example of one day's HTML, generated by Old School, for discussion purposes.
<div class="divDayContainer" id="idDayContainer">
<div class="divDayTitle">
<a href="http://scripting.com/2020/10/30.html">Friday, October 30, 2020</a>
</div>
<div class="divSingularItem" data-type="outline" data-commentsetup="true">
<a name="a143253"></a>
<a href="http://this.how/frontier/nodeEditorExample.opml">A new doc</a> explains, through an example, how my Frontier-based code-writing system for JavaScript works. I started this suite about seven years ago, and have been using it ever since. It allows me to edit my code in an outliner, and use Frontier's scripting ability to distribute the results to S3, GitHub, NPM and pretty much anywhere else I want.
<span class="spPermaLink">
<a href="http://scripting.com/2020/10/30.html#a143253" title="Direct link to this item.">#</a>
</span>
@scripting
scripting / demoblog.opml
Last active November 11, 2020 20:48
An OPML file for use with Old School, that shows how to include an About page.
<?xml version="1.0"?>
<opml version="2.0">
<head>
<title>demoblog.opml</title>
<dateCreated>Wed, 11 Nov 2020 17:14:44 GMT</dateCreated>
<dateModified>Wed, 11 Nov 2020 17:20:45 GMT</dateModified>
<flPublic>true</flPublic>
<expansionState>1,2,4,14,15</expansionState>
<lastCursor>14</lastCursor>
<ownerId>https://twitter.com/davewiner/</ownerId>
@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);
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 / 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);
@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"
}
{
"github": {
"username": "scripting",
"repo": "instantOutlines",
"repoPath": "",
"password": "xxx",
"committer": {
"name": "Bull Mancuso",
"email": "[email protected]"
},