rename to blocklist to be consistent with the api endpoint
This commit is contained in:
parent
dfcb289603
commit
aae18e451e
@ -1,4 +1,4 @@
|
|||||||
# sudofox/mojang-blacklist
|
# sudofox/mojang-blocklist
|
||||||
|
|
||||||
I figured I'd try to get a more comprehensive list of the domains blocked by Mojang, so this is my stab at it.
|
I figured I'd try to get a more comprehensive list of the domains blocked by Mojang, so this is my stab at it.
|
||||||
|
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "mojang-blacklist",
|
"name": "mojang-blocklist",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "mojang-blacklist",
|
"name": "mojang-blocklist",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "tracking and identifying blacklisted minecraft servers",
|
"description": "tracking and identifying blocklisted minecraft servers",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// fetch the blacklisted servers from https://sessionserver.mojang.com/blockedservers and stick it in data/current.txt
|
// fetch the blocklisted servers from https://sessionserver.mojang.com/blockedservers and stick it in data/current.txt
|
||||||
|
|
||||||
// import http, path, and fs
|
// import http, path, and fs
|
||||||
var http = require('https');
|
var http = require('https');
|
||||||
@ -11,7 +11,7 @@ var current_path = path.join(__dirname, 'data', 'current.txt');
|
|||||||
var current_file = fs.readFileSync(current_path, 'utf8');
|
var current_file = fs.readFileSync(current_path, 'utf8');
|
||||||
var current_hash_count = current_file.split('\n').length;
|
var current_hash_count = current_file.split('\n').length;
|
||||||
|
|
||||||
// fetch the blacklisted servers from https://sessionserver.mojang.com/blockedservers
|
// fetch the blocklisted servers from https://sessionserver.mojang.com/blockedservers
|
||||||
http.get('https://sessionserver.mojang.com/blockedservers?' + Math.floor(Math.random() * 999999), function(res) {
|
http.get('https://sessionserver.mojang.com/blockedservers?' + Math.floor(Math.random() * 999999), function(res) {
|
||||||
var body = '';
|
var body = '';
|
||||||
res.on('data', function(chunk) {
|
res.on('data', function(chunk) {
|
||||||
@ -30,7 +30,7 @@ http.get('https://sessionserver.mojang.com/blockedservers?' + Math.floor(Math.ra
|
|||||||
|
|
||||||
console.log("Writing " + new_hash_count + " hashes (old count: " + current_hash_count + ")");
|
console.log("Writing " + new_hash_count + " hashes (old count: " + current_hash_count + ")");
|
||||||
|
|
||||||
// write the blacklisted servers to data/current.txt
|
// write the blocklisted servers to data/current.txt
|
||||||
fs.writeFile(current_path, body, function(err) {
|
fs.writeFile(current_path, body, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
Loading…
Reference in New Issue
Block a user