Skip to content

Commit

Permalink
Update nodes.json with restVersion changes
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet committed Apr 9, 2024
1 parent ae83251 commit a6d13c6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
8 changes: 4 additions & 4 deletions nodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"identifier": "GlassHost - NY1",
"password": "glasshost1984",
"port": 2269,
"restVersion": "v3",
"restVersion": "v4",
"secure": false
},
{
Expand Down Expand Up @@ -266,7 +266,7 @@
"port": 8028,
"password": "hanmetaforce",
"secure": false,
"restVersion": "v4",
"authorId": "917913229668274186"
"authorId": "917913229668274186",
"restVersion": "v4"
}
]
]
21 changes: 17 additions & 4 deletions remove_duplicates.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import json

# Load data from nodes.json
with open('nodes.json') as f:
data = json.load(f)

# Function to remove duplicate nodes
def remove_duplicates(data):
seen_identifiers = set()
Expand All @@ -15,6 +11,20 @@ def remove_duplicates(data):
unique_data.append(node)
return unique_data

# Function to add restVersion if it is missing
def add_restVersion(data):
for node in data:
if 'restVersion' not in node:
node['restVersion'] = 'v4'
return data

# Load data from nodes.json
with open('nodes.json') as f:
data = json.load(f)

# Add restVersion if it is missing
data = add_restVersion(data)

# Remove duplicates
unique_data = remove_duplicates(data)

Expand All @@ -28,3 +38,6 @@ def remove_duplicates(data):
else:
print("No duplicate nodes found.")

# Save data with restVersion added
with open('nodes.json', 'w') as f:
json.dump(data, f, indent=4)

0 comments on commit a6d13c6

Please sign in to comment.