Skip to content

Commit d2828d2

Browse files
authored
update
1 parent f24ce5d commit d2828d2

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

src/wrapper.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,28 @@
4444
print(f"Remixes: {remixes}")
4545
print("=" * 50)
4646
print("\n")
47-
if utility == "exit":
48-
os.exit()
49-
else:
50-
print("thats not an option right now!")
47+
if utility == "follower-wrapping-utility":
48+
# url
49+
url = f"https://api.scratch.mit.edu/users/{username}/followers/"
50+
# get data
51+
response = urllib.request.urlopen(url)
52+
data = json.loads(response.read())
53+
# display info
54+
print("=" * 50)
55+
print(f"Followers for {username}")
56+
print("=" * 50)
57+
58+
for follower in data:
59+
follower_name = follower.get('username', 'Unknown')
60+
61+
print("FOLLOWER USERNAME")
62+
print("-" * 50)
63+
print(f"{follower_name}")
64+
65+
# If you want to fetch and display more follower details, add additional fields here
66+
print("=" * 50)
67+
print("\n")
68+
if utility == "exit":
69+
os.exit()
70+
else:
71+
print("thats not an option right now!")

0 commit comments

Comments
 (0)