-
-
Save Draknek/1719f7d01e43f233836e8b2abe6b2ae8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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