SO-ChatBot
SO-ChatBot copied to clipboard
Daily backup
I run this script in my mac now and it backs up the bot, maybe we should just do a setInterval in the bot to create daily backups
function run(input, parameters) {
ObjC.import('stdlib')
var app = Application.currentApplication();
app.includeStandardAdditions = true;
var g = Application("Google Chrome");
var tabs = g.windows().map(x => x.tabs()).reduce((p, c) => p.concat(c));
var chat = tabs.find(x => String(x.url()).includes("chat.stackoverflow.com/rooms/17"));
if(!chat) { // no tab yet
var window = g.windows[0];
window.tabs.push(chat = g.Tab());
chat.url.set("chat.stackoverflow.com/rooms/17/");
}
$.system("sleep 2");
chat.execute({javascript: `
document.querySelector("#bubble #input").value = ("!!backup");
document.querySelector("#sayit-button").click();
`});
}
I've fixed the backup command in ab362fde233e02a97c67b48e298917af83483b41
Do we still want to schedule this?
@rlemon yes please
okay. Daily? Weekly? what is reasonable?
Weekly sounds reasonable - just so we don't lose too many commands and memories