Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Daily backup #287

Open
benjamingr opened this issue Aug 4, 2017 · 4 comments
Open

Daily backup #287

benjamingr opened this issue Aug 4, 2017 · 4 comments

Comments

@benjamingr
Copy link
Contributor

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();
	`});
}
@rlemon
Copy link
Collaborator

rlemon commented Apr 18, 2018

I've fixed the backup command in ab362fd

Do we still want to schedule this?

@benjamingr
Copy link
Contributor Author

@rlemon yes please

@rlemon
Copy link
Collaborator

rlemon commented Apr 19, 2018

okay.
Daily? Weekly? what is reasonable?

@benjamingr
Copy link
Contributor Author

Weekly sounds reasonable - just so we don't lose too many commands and memories

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants