File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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!" )
You can’t perform that action at this time.
0 commit comments