Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / gist:afc95f1b951978c58ad7
Created September 20, 2014 12:39
CORS config for S3 bucket that allows access from River Browser
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
<html>
<head>
<title>Hello River</title>
<!--
The Hello World of Rivers
https://github.com/scripting/river5/blob/master/docs/HELLOWORLD.md
-->
@scripting
scripting / viewRadio3Linkblog.html
Created November 6, 2014 18:01
View a Radio3 user's links, in reverse-chronologic order
<html>
<head>
<title>View Linkblog</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://fargo.io/code/bootstrap.css" rel="stylesheet">
<script src="http://fargo.io/code/bootstrap.min.js"></script>
@scripting
scripting / gist:f807694bf08f85599717
Created January 8, 2015 17:05
A script I have running as an endpoint on my PagePark server.
var s = "";
for (var i = 1; i < 1000; i++) {
s += i + "\r\n";
}
s;
@scripting
scripting / pageParkScript.js
Last active June 18, 2017 12:27
A script I have running as an endpoint on my PagePark server.
var s = "<ul>";
for (var i = 1; i <= 10; i++) {
s += "<li>" + i + "</li>";
}
s += "</ul>";
s;
@scripting
scripting / config.json
Created January 17, 2015 09:37
An example of a config.json file used for the tweetsToRss app.
{
"folder": "feeds/",
"items": [
{
"username": "Circa",
"feedname": "circa.xml"
},
{
"username": "reportedly",
"feedname": "reportedly.xml"
@scripting
scripting / config.json
Created January 18, 2015 15:47
Example config.json file for PagePark.
{
"urlSiteRedirect": "http://nodestorage.io"
}
@scripting
scripting / buildLiveblogOpml
Created January 30, 2015 18:26
A Frontier script that generates the OPML subscription list for liveblog.co. An example script for Marco.
on buildLiveblogOpml () {
«Changes
«1/30/15; 12:19:27 PM by DW
«Created.
local (jsontext = tcp.httpreadurl ("http://liveblog.co/prefs/userwhitelist.json"), jstruct);
json.compile (jsontext, @jstruct);
«scratchpad.jstruct = jstruct
local (xstruct = nodeEditorSuite.data.opmlShellStruct, now = clock.now ());
local (adrbody = xml.opml.getBodyAddress (@xstruct), adritem, name, i);
@scripting
scripting / readOpml.js
Last active August 29, 2015 14:15
A routine that builds on Dan MacTough's opmlparser package for node.js. I think this should be part of what's released in opmlparser. It's a higher level interface, and much easier for the app that's using opmlparser to deal with. It actually generates a JavaScript tree structure from the OPML.
function readOpml (urloutline, callback) {
var outlineArray = new Array ();
var req = request (urloutline);
var opmlparser = new opmlParser ();
req.on ("response", function (res) {
var stream = this;
if (res.statusCode == 200) {
stream.pipe (opmlparser);
}
@scripting
scripting / test.js
Created February 19, 2015 00:39
Example script for PagePark pages that need to do something asynchronous, like reading a file over the web.
httpReadUrl ("http://scripting.com/misc/uppertext.txt", function (s) {
httpReturn (s.toUpperCase (), "text/plain");
});
undefined; //return undefined so PagePark knows not to return a value