diff --git a/data/current.txt b/data/current.txt index 99e4603..047136f 100644 --- a/data/current.txt +++ b/data/current.txt @@ -2167,14 +2167,10 @@ ba2a959810ed42b040fe6aa3874b7f01b99b71b1 87374110aaf888ba666cfb0021c84cf7514fcc7f 35d5703ba03161a9731bb22d489ebea05961fa36 cb01c0a34221f05062a8de1d9bb89c752546d534 -371828959c14592085754532a2b4220e60e3f0da -7e5bbeb43477681bf45a34eb183cae260301a253 41749bb88220d5cb9fffc11624742fa01ae5a97d 54fbf7b93a67cf856abab926cbb8fbc00559f339 -13791ef87851b0c81af52405830f07c55eac923d 68d8da226dabd07200acbd5f50b9507ab28248f7 b88c908d8e751d64ab883639f04944f2a365db83 -6ddf48140859b7c6ec877337f703f246e8983cfd a66df261120b6c2311c6ef0b1bab4e583afcbcc0 47f35f2106f6f9c57ab03774d439e2a788ef6e94 3b07fbf8a3ffcddbce8ea2eabc6ae5eed07056a2 @@ -2302,9 +2298,6 @@ c1b5fe526ff87c3161db9310bf8aef82ca17a5a8 f80248bc8453a191e10971cff922e7bee40b9268 63ceeb859c87e3842faa6f34e1925549a3d74007 eb166b70ec693a673f32ad347bfd7a1d3566d768 -5a14ff24e432bfac51163e72323e8a8186968a67 -935e2243ef98330b624f23f4f1ac4c7dc336aba8 -ae602be25e1909399298537b63f1b3e23a31fe5a c17c6e1214c52f58ae355037f7188b8b4108333a a71be8cf63f63b0fefc489f68ea8300ab487661f a47d957b4ace8d7187a0bf733f8156ed18af1c13 diff --git a/data/todo.txt b/data/todo.txt index 1f45e97..24de9c6 100644 --- a/data/todo.txt +++ b/data/todo.txt @@ -7,7 +7,6 @@ 0db08a711a9a97e0dfd0bd8c9e8a0a2e7e4c9b59 10e1779f0e24fe215057e5384eb96be9e36b31b8 115c43b865ba3be88b641bb8c6c6ee6196fc241b -13791ef87851b0c81af52405830f07c55eac923d 145cec1a2b5213969beb23be3cdce7e907d0128e 14d10faf7273b705285f1ece8a43008f72e0300e 17b0b347c505857ff7af1a7d9f101a756023b61d @@ -40,7 +39,6 @@ 337dd5423d130c3fb73f164f9b10f1099d08c352 365361e28d91e5460843d31bfb6009de2df06d84 36b5bc7b143813e73e8b7c8de20efbd7ba0f2ab3 -371828959c14592085754532a2b4220e60e3f0da 3916ba12f8842b1724bf3203a46f68288db063e7 3bd3a060b55cc8ea72da8cfad393aeb99ba97c4a 3ca31a89639d62648d56319fdc68a6697d4e7339 @@ -71,7 +69,6 @@ 55c862b77be2fe5dfa7f070ce8399b08e6346bcf 56c567dd1ecaebda96b661d99413d34e989830cb 5774418c4f9307c2770fea421fcaad2dba7d1e76 -5a14ff24e432bfac51163e72323e8a8186968a67 5b487786b10fc8e1f87aee64e237b1c9394df9e2 5bec25f1b498dcc60264405663833b5afdc63cea 5c720a83d03808e4e85fee95939d064d3b71b1d1 @@ -99,7 +96,6 @@ 77e873325d32a68dc845b5ad4b8550336cd1707b 7975b84527a1f477e691794f3e122a4658a63247 7d9d3fbddc30d76de81a80b1e72d0c79496b5533 -7e5bbeb43477681bf45a34eb183cae260301a253 7f0ffc1d1f66fcf8e2d8322c62282f5deb66e1d7 7f67510021c4236a7b36a17436fcb6ce37743310 7f7bbb2104a200c111ac024ee1cfae81be34a634 @@ -115,7 +111,6 @@ 8f6df8b65e5e98394bb38cfec6877c28d2bf8cc2 8f9c31128306c2f7cb6162ef82cc952ac455c423 914dc8ca74469a25a384d0d01ca1ca5ac3585fd2 -935e2243ef98330b624f23f4f1ac4c7dc336aba8 95fddbcdc0923d56b1ecd066974996054b403357 9628751744cdb9f833b1e58b51dbdfca0a0dd722 96ea6aaf66aea5881b38ebbf66df686e8613f1db @@ -137,7 +132,6 @@ ab0ca0005d802bd5fade0e5f3e88fe521602b621 abd36c666eadf72a9317c00eb021779b0a0e9477 ad0569b0b7069c223053ed0ceb10bc2e3dde77fc ad4907bd3e892a35e101d63600dbd30bb9120ffc -ae602be25e1909399298537b63f1b3e23a31fe5a aeb1909df14137c422a58dfac2a35dcbb84766a5 b0a0277c4b9b143a4471cab5dd2d25797e21fd00 b58b2d8d31d9892234f39beaac0408486589d272 diff --git a/fetch_list.js b/fetch_list.js deleted file mode 100644 index e2f4cf2..0000000 --- a/fetch_list.js +++ /dev/null @@ -1,24 +0,0 @@ -// fetch the blacklisted servers from https://sessionserver.mojang.com/blockedservers and stick it in data/current.txt - -// import http, path, and fs -var http = require('https'); -var path = require('path'); -var fs = require('fs'); - -var current_path = path.join(__dirname, 'data', 'current.txt'); - -// fetch the blacklisted servers from https://sessionserver.mojang.com/blockedservers -http.get('https://sessionserver.mojang.com/blockedservers', function(res) { - var body = ''; - res.on('data', function(chunk) { - body += chunk; - }).on('end', function() { - - // write the blacklisted servers to data/current.txt - fs.writeFile(current_path, body, function(err) { - if (err) { - console.log(err); - } - }); - }) - }) diff --git a/update_blocklist.js b/update_blocklist.js new file mode 100644 index 0000000..add8821 --- /dev/null +++ b/update_blocklist.js @@ -0,0 +1,40 @@ +// fetch the blacklisted servers from https://sessionserver.mojang.com/blockedservers and stick it in data/current.txt + +// import http, path, and fs +var http = require('https'); +var path = require('path'); +var fs = require('fs'); + +var current_path = path.join(__dirname, 'data', 'current.txt'); + +// first, get the number of hashes that we already have +var current_file = fs.readFileSync(current_path, 'utf8'); +var current_hash_count = current_file.split('\n').length; + +// fetch the blacklisted servers from https://sessionserver.mojang.com/blockedservers +http.get('https://sessionserver.mojang.com/blockedservers', function(res) { + var body = ''; + res.on('data', function(chunk) { + body += chunk; + }).on('end', function() { + + // count the number of hashes that we have now + var new_hash_count = body.split('\n').length; + + // if the new hash count is less than 1/2 the old hash count, then abort + // saw this simple logic used in the BlockedServers checker, figured I'd add it just in case. thanks minecoder + if (new_hash_count < current_hash_count / 2) { + console.log('Aborting: new hash count is less than 1/2 the old hash count, assuming something went wrong'); + return; + } + + console.log("Writing " + new_hash_count + " hashes (old count: " + current_hash_count + ")"); + + // write the blacklisted servers to data/current.txt + fs.writeFile(current_path, body, function(err) { + if (err) { + console.log(err); + } + }); + }) + })