Skip to content

Instantly share code, notes, and snippets.

@Draknek Draknek/README Secret
Last active Oct 30, 2017

Embed
What would you like to do?
Usage:
1) download node.js version 6 or higher
2) Run `npm install levelup leveldown`
3) Close Chrome
4) Run `node savepuzzles.js`
5) Reopen Chrome, cross fingers
var levelup = require('levelup')
var leveldown = require('leveldown')
var db = levelup(leveldown(process.env.LOCALAPPDATA + '/Google/Chrome/User Data/Default/Local Storage/leveldb'));
var url = '_http://www.puzzlescript.net';
var key = Buffer.alloc(url.length + 2 + 5, url);
key.writeInt8(0, url.length);
key.writeInt8(1, url.length+1);
key.write('saves', url.length+2);
var url2 = '_https://www.puzzlescript.net';
var key2 = Buffer.alloc(url2.length + 2 + 5, url2);
key2.writeInt8(0, url2.length);
key2.writeInt8(1, url2.length+1);
key2.write('saves', url2.length+2);
db.get(key, function (err, value) {
if (err) {
if (err.notFound) {
// handle a 'NotFoundError' here
console.log('not found');
}
// I/O or other error
console.log(err);
}
//console.log(value.toString());
db.put(key2, value, function (err){
if (err) {
return console.log('Ooops!', err) // some kind of I/O error
}
console.log('copied to https');
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.