Ubuntu start script, HERO ticker, Chrome default browser

This commit is contained in:
2025-02-22 20:36:23 -05:00
parent 05231501e7
commit 82baa8a23d
12 changed files with 113 additions and 34 deletions

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python
import requests
def get_tier_value(num):
url = f"https://www.glhfers.com/api/rom-metadata/{num}"
try:
response = requests.get(url)
response.raise_for_status() # Raise an error for bad status codes
data = response.json()
# Find the Tier trait value
for attribute in data.get("attributes", []):
if attribute.get("trait_type") == "Tier":
return attribute.get("value")
# value = attribute.get("value")
return "Tier not found"
except requests.exceptions.RequestException as e:
return f"Error fetching data: {e}"
def main():
while True:
try:
num = input("Enter a number: ")
if num.lower() == 'exit':
break
num = int(num) # Convert input to integer
tier_value = get_tier_value(num)
print(f"{tier_value}")
except ValueError:
print("Invalid input. Please enter a number or 'exit' to quit.")
if __name__ == "__main__":
main()