Hi ! Yesterday @StormzTheMemer asked if there was a fast and easy way to check if a list of IDs are available on Origin.
And I made a small and simple Python script just to do that.
You can download it on GitHub. You just have to write the IDs you want to verify in the file "ids.txt", run the "run.bat" file and the results will be written in a new file called "out.txt".
It's not much, I guess there are multiple other ways and languages to do that, but hey Python is fast and easy to write.
If there are any problems, just let me know.
And for anyone suspicious about the code, here it is.
EDIT : refactored the code a bit for an easier integration with the NRU bot
Another EDIT : here it is on GitHub : GitHub - florian-bougeatre/originID: Made a program to check if origin ids are available
And I made a small and simple Python script just to do that.
You can download it on GitHub. You just have to write the IDs you want to verify in the file "ids.txt", run the "run.bat" file and the results will be written in a new file called "out.txt".
It's not much, I guess there are multiple other ways and languages to do that, but hey Python is fast and easy to write.
If there are any problems, just let me know.
And for anyone suspicious about the code, here it is.
Python:
import requests
# AUTHOR : Belgrobin/Belgobrine/florian-bougeatre
# Get ids from file
# If file not exist, create it
# Return ids array
def get_ids():
filepath_in = "./ids.txt"
try:
ids = [line.removesuffix('\n') for line in open(filepath_in).readlines() if not line.startswith('#')]
except FileNotFoundError:
open(filepath_in, "w").write("#Start writing the ids to test below\n#Exemple :\nBelgobrine\nBelgrobrin")
ids = [line.removesuffix('\n') for line in open(filepath_in).readlines() if not line.startswith('#')]
finally:
return ids
# Write the output array to file
def output(output_arr):
filepath_out = "./out.txt"
open(filepath_out, "a").writelines(output_arr)
# Iterate over ids array
# Verify the ids on Origin
# Write the result out array
def verify_ids(ids_arr):
url = "https://signin.ea.com/p/ajax/user/checkOriginId?requestorId=portal&originId="
out = []
for id in ids_arr:
json = requests.get(url + id).json()
status, message = json["status"], json["message"]
print(id, status, message)
if status:
out.append(f"{id} IS VALID\n")
elif message == "origin_id_duplicated":
out.append(f"{id} IS DUPLICATED\n")
elif message == "origin_id_not_allowed":
out.append(f"{id} IS NOT ALLOWED\n")
else:
out.append(f"{id} IS OTHER : {message}\n")
return out
# Gets the ids
# Verify the ids
# Sends the results array to output function
output(verify_ids(get_ids()))
Code:
.\venv\Scripts\python.exe originID.py
EDIT : refactored the code a bit for an easier integration with the NRU bot
Another EDIT : here it is on GitHub : GitHub - florian-bougeatre/originID: Made a program to check if origin ids are available
Last edited: