Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
View idea.pseudojson
{
"title": "People and Blogs",
"script": "console.log('Made with FeedLand - https://feedland.com'); var ribbon = document.createElement('div'); ribbon.classList.add('ribbon'); ribbon.innerHTML = '<a href=\"https://feedland.com\" target=\"_blank\">Made with FeedLand</a></div>'; document.getElementsByClassName('divPageBody')[0].appendChild(ribbon);",
"style": <code>
body { font-family: 'Sentient', 'Georgia',serif; background-color: #fffcf2; }
.ribbon { background-color: #f2a93c; overflow: hidden; white-space: nowrap; position: absolute; left: -50px; top: 40px; transform: rotate(-45deg); box-shadow: 0 0 10px #999;}
.ribbon a { color: #fff; display: block; font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif; margin: 1px 0; padding: 8px 50px; text-align: center; text-decoration: none; }
.divNewsProduct .divProductTitle { font-family: unset; letter-spacing: unset; }
.divTabsContainer .divTabs li { font-family: unset; }
.divPageBody
@scripting
scripting / test.json
Last active January 23, 2024 15:33
I am testing to see if the URL of a Gist changes when you edit it
View test.json
{
"githubServeFrom": {
"username": "scripting",
"repository": "SomePrivateRepoasdfasdfxxxx",
"path": "docs",
"accessToken": "hellofromsanjose"
},
"indexFilename": "README",
"urlDefaultMarkdownTemplate": "https://s3.amazonaws.com/scripting.com/code/feedland/docswebsite/markdowntemplate.txt",
View uploadReadingList.ftsc
on saveReadingList (screenname, catname, fname) {
local (url = "https://feedland.com/opml?screenname=" + screenname + "&catname=" + catname);
local (opmltext = tcp.httpreadurl (url));
file.writewholefile (githubfolder + "lists:" + fname, opmltext)
};
saveReadingList ("davewiner", "podcasts", "davepodcasts.opml")
@scripting
scripting / bingeworthy.sql
Created December 1, 2023 15:12
SQL code to create Bingeworthy database
View bingeworthy.sql
create table programs (
id varchar (255),
type varchar (32),
title varchar (255),
screenname varchar (255),
approved boolean,
whencreated datetime,
whenmodified datetime,
primary key (id)
);
View riverReader.js
const urlRiver = "https://feedland.org/getriverfromreadinglist?url=https://lists.feedcorps.org/artshow.opml";
function httpRequest (url, timeout, headers, callback) {
timeout = (timeout === undefined) ? 30000 : timeout;
var jxhr = $.ajax ({
url: url,
dataType: "text",
headers,
timeout
})
View gist:36bec44af6892abb870c5fa798bf7431
on letsWatchThatStinkingFolder () {
«Changes
«3/7/23; 11:55:58 AM by DW
«Created.
local (prefix = "chat-gpt-");
local (sourcefolder = "Macintosh HD:Users:davewiner:Downloads:");
local (destfolder = user.prefs.publicfolder + "chatgpt:");
fileloop (f in sourcefolder) {
local (fname = file.filefrompath (f));
if fname beginswith prefix {
@scripting
scripting / config.json
Created October 2, 2023 14:56
An example of a PagePark config.json file to access a private repo via the web
View config.json
{
"githubServeFrom": {
"username": "scripting",
"repository": "SomePrivateRepo",
"path": "docs",
"accessToken": "hellofromsanjose"
},
"indexFilename": "README",
"urlDefaultMarkdownTemplate": "https://s3.amazonaws.com/scripting.com/code/feedland/docswebsite/markdowntemplate.txt",
"pageParams": {
@scripting
scripting / testUserDatafile.js
Last active September 24, 2023 22:04
The test FeedLand runs to be sure static memory is working by calling the server to set and get a JSON file
View testUserDatafile.js
function testUserDatafiles (ctsecs=0) { //9/19/23 by DW
function oneTest (callback) {
const fname = "test.json", whenstart = new Date ();
var theTestData = {
theArray: new Array ()
}
for (var i = 1; i <= 15; i++) {
theTestData.theArray.push (getRandomSnarkySlogan ());
}
uploadUserDataFile (fname, jsonStringify (theTestData), "application/json", true, function (err, data) {
View gist:bb9efb24b34d71380ba74a99deefd704
function testUserDatafiles (ctsecs=0) { //9/19/23 by DW
const fname = "test.json", whenstart = new Date ();
var theTestData = {
theArray: new Array ()
}
for (var i = 1; i <= 15; i++) {
theTestData.theArray.push (getRandomSnarkySlogan ());
}
console.log ("testUserDatafiles");
console.log ("theTestData == " + jsonStringify (theTestData));
@scripting
scripting / fatPages.confirmAddress.ftsc
Created August 17, 2023 14:18
Example script for a blog post
View fatPages.confirmAddress.ftsc
<!--
#fatPage
#version 1
#docs http://www.scripting.com/fatPages/faq.html
#adrPageData system.verbs.builtins.fatPages.confirmAddress
#objectType application/x-frontier-scpt
#runnable false
#pageData AAEEAAACAAAC9wAABl8AAgAAAA8GR2VuZXZhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAEAAAAAAAAAALFQIA7hA6ElAAAAQQAAAO4CSAPcBUhMQU5E////////AAAAAAAAbWFjIAAAAAAAAAAAAAAAAG9uIGNvbmZpcm1BZGRyZXNzIChhZHIpDQlDaGFuZ2VzDQkJOC8xNy8yMzsgMTA6MDA6NDggQU0gYnkgRFcNCQkJV2hlbiB3ZSBwcm9tcHQgZm9yIHRoZSBhZGRyZXNzLCBwb3AgdGhlIGZpbGUgZnJvbSB0aGUgYWRkcmVzcyB0b28uDQkJMy8zMS8yMDA0OyAxOjM3OjM4IFBNIGJ5IEpFUw0JCQlVc2Ugc3RyaW5nLnBvcEZpbGVGcm9tQWRkcmVzcyB0byBzaG9ydGVuIHRoZSBhZGRyZXNzIGluIHRoZSByZXBsYWNlIGNvbmZpcm1hdGlvbiBkaWFsb2cuDQlsb29wIC8vZ2V0IGRlc3RpbmF0aW9uIGFkZHJlc3MgZnJvbSB0aGUgdXNlciwgY29uZmlybWF0aW9uDQkJb24gcG9wUGF0aCAocykNCQkJbG9jYWwgKGksIGZsYnJhY2tldHMgPSBmYWxzZSwgY2gpDQkJCWxvY2FsIChmbHF1b3RlcyA9IGZhbHNlKQ0JCQlmb3IgaSA9IHNpemVvZiAocykgZG93bnRvIDINCQkJCWNoID0gcyBbaV0NCQkJCWlmIGNoID09ICciJw0JCQkJCWlmIHMgW2kgLSAxXSAhPSAnXFwnDQkJCQkJCWlm