Last active
October 19, 2017 14:37
-
-
Save Announcement/b48c358b2130a99800a32dcd90eddb86 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
var sqlite = require('sqlite3') | |
var db = new sqlite.Database('/home/tomato/.mozilla/firefox/kbp250uo.dev/places.sqlite') | |
function each (query) { | |
return new Promise((resolve, reject) => { | |
try { | |
db.each(query, resolve) | |
} catch (exception) { | |
reject(exception) | |
} | |
}) | |
} | |
async function main (..args) { | |
let results | |
let query | |
let done | |
query = `SELECT fk FROM moz_bookmarks WHERE type=1 ORDER BY lastModified` | |
results = await each(query) | |
done = [] | |
if (done.indexOf(row.fk) === -1) { | |
done.push(row.fk) | |
console.log(row.fk) // this prints lots of numbers | |
} | |
console.log(done) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment