View uploadToGithub.js
const request = require ("request");
const fs = require ("fs");
var myPost = {
username: "scripting",
repo: "test1",
path: "ideas/plot.html",
content: "<!DOCTYPE html>\n<html><body>A programmer writes a demo app. Everyone lives happily ever after.</body></html>",
type: "text/html",
committer: {
View runUserScript.js
function runUserScript (s, scriptName) {
var now = new Date ();
function msg (s) {
var package = {
text: s,
path: scriptName
};
bullMancuso.send ("callback", "msg", utils.jsonStringify (package));
}
function persist (objectName) {
View systemScript.ftsc
local (sourcefolder = user.prefs.dropboxfolder + "public:misc:nodeeditor:fargo.io-code-publisher:");
local (githubfolder = user.prefs.githubfolder + "fargoPublisher:");
local (montaukfolder = user.prefs.dropboxfolder + "montauk:fargopub:");
on copyone (f1, f2) {
file.surefilepath (f2);
try {
if file.readwholefile (f1) != file.readwholefile (f2) {
file.copy (f1, f2)
}
View config.json
{
"localPath": "/home/ubuntu/Dropbox/Nodescripts2/littleoutliner/publicFiles"
}
View config.json
{
"watchFolder": "/Users/davewiner/publicFolder/",
"s3Folder": "/scripting.com/publicfolder/",
"urlS3Folder": "http://scripting.com/publicfolder/"
}
View example.js
//see blog post here -- http://scripting.com/2017/09/06.html#a094746
function openLinksInExternalWindow () {
$(document).off ("click", 'a[href^="http"]'); //remove pre-existing click handlers
$(document).on ("click", 'a[href^="http"]', function (event) {
event.preventDefault ();
electron.shell.openExternal (this.href);
});
}
View helloworld.js
var AWS = require ("aws-sdk");
var s3 = new AWS.S3 ();
const params = {
Bucket: "bloatware.org",
Key: "/testing/hello.txt",
Body: "Hello World",
ContentType: "text/plain",
ACL: "public-read"
};
s3.putObject (params, function (err, data) {
View permissions.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": ["arn:aws:s3:::bloatware.org"]
},
{
"Effect": "Allow",
View tweetsInMyRss.xml
<item>
<description>Instead of Trump growing to fill the presidency, he's shrinking the presidency to fit Trump.</description>
<pubDate>Wed, 28 Jun 2017 14:00:37 GMT</pubDate>
<link>http://scripting.com/2017/06/28.html#a100637</link>
<guid>http://scripting.com/2017/06/28.html#a100637</guid>
<source:outline created="Wed, 28 Jun 2017 14:00:37 GMT" type="tweet" tweetId="880063536352899074" tweetUserName="davewiner" permalink="http://scripting.com/2017/06/28.html#a100637" text="Instead of Trump growing to fill the presidency, he's shrinking the presidency to fit Trump." />
</item>
<item>
View hello.js
const githubpub = require ("githubpub");
var config = {
port: 5376,
domains: {
"githubpub.scripting.com": {
username: "scripting",
repository: "Scripting-News",
path: "githubpub"
}