-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Implement a method/attribute in the site.user.User class
class User:
# <...>
def classroom(self) -> classroom.Classroom | None:
... # If this is a student user, return a classroom object. If not, return NoneThe regular api (api.scratch.mit.edu/users/{username}) does not provide classroom information, so this would require parsing of the user's profile page (scratch.mit.edu/users/{username})
Look for a href that follows this regular expression: \/classes\/\d*\/. if it exists within this <p class="profile-details"> tag, then the user is a student. Otherwise, they are not.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
