here's a python script that i (chatgpt) wrote that decrease score of each entry by one point
import xml.etree.ElementTree as ET
# Load and parse the XML file
tree = ET.parse('list.xml')
root = tree.getroot()
# Iterate through each anime element and update the score and update_on_import
for anime in root.findall('.//anime'):
my_score = anime.find('my_score')
if my_score is not None and my_score.text.isdigit():
if int(my_score.text) == 0:
continue
new_score = int(my_score.text) - 1
my_score.text = str(new_score)
update_on_import = anime.find('update_on_import')
if update_on_import is None:
update_on_import = ET.SubElement(anime, 'update_on_import')
update_on_import.text = '1'
# Save the modified XML back to the file
tree.write('list.updated.xml')
All Comments (1) Comments