-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
532 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
const db = require('level')('./db') | ||
const fs = require('fs') | ||
const path = require('path') | ||
const urlencode = require('urlencode') | ||
let good = 0 | ||
let bad = 0 | ||
|
||
db.createReadStream() | ||
.on('data', async ({key, value}) => { | ||
value = JSON.parse(value) | ||
if (value && Object.keys(value).length) { | ||
good++ | ||
} else { | ||
bad++ | ||
} | ||
console.log(good, bad) | ||
}) |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
MANIFEST-000025 | ||
MANIFEST-000232 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
2018/01/15-12:39:49.619498 70000a01a000 Recovering log #223 | ||
2018/01/15-12:39:49.627377 70000a01a000 Level-0 table #233: started | ||
2018/01/15-12:39:49.634932 70000a01a000 Level-0 table #233: 401226 bytes OK | ||
2018/01/15-12:39:49.636255 70000a01a000 Delete type=2 #5 | ||
2018/01/15-12:39:49.636502 70000a01a000 Delete type=2 #16 | ||
2018/01/15-12:39:49.637256 70000a01a000 Delete type=2 #17 | ||
2018/01/15-12:39:49.637585 70000a01a000 Delete type=2 #18 | ||
2018/01/15-12:39:49.638321 70000a01a000 Delete type=2 #19 | ||
2018/01/15-12:39:49.638411 70000a01a000 Delete type=2 #21 | ||
2018/01/15-12:39:49.638969 70000a01a000 Delete type=2 #23 | ||
2018/01/15-12:39:49.639074 70000a01a000 Delete type=0 #223 | ||
2018/01/15-12:39:49.639347 70000a01a000 Delete type=3 #22 |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
const db = require('level')('./db') | ||
const fs = require('fs') | ||
const path = require('path') | ||
const urlencode = require('urlencode') | ||
|
||
let extant = 0 | ||
let nonexistent = 0 | ||
db.createKeyStream() | ||
.on('data', async (name) => { | ||
const dataFile = path.join(__dirname, '../sourceranks/data', urlencode(name) + '.json') | ||
if (fs.existsSync(dataFile)) { | ||
await saveRank(name, dataFile) | ||
console.log(dataFile, 'exists') | ||
extant++ | ||
} else { | ||
nonexistent++ | ||
console.log(dataFile, 'DOES NOT EXIST') | ||
} | ||
}) | ||
.on('end', () => { | ||
console.log('done', extant, nonexistent) | ||
}) | ||
|
||
async function saveRank (name, dataFile) { | ||
db.put(name, JSON.stringify(require(dataFile), null, 2)) | ||
} |
This file contains 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