Returns: dict: Gets info on the user's featured project and featured label (like "Featured project", "My favorite things", etc.)
(self)
| 330 | )["count"] |
| 331 | |
| 332 | def featured_data(self): |
| 333 | """ |
| 334 | Returns: |
| 335 | dict: Gets info on the user's featured project and featured label (like "Featured project", "My favorite things", etc.) |
| 336 | """ |
| 337 | try: |
| 338 | response = requests.get(f"https://scratch.mit.edu/site-api/users/all/{self.username}/").json() |
| 339 | return { |
| 340 | "label": response["featured_project_label_name"], |
| 341 | "project": dict( |
| 342 | id=str(response["featured_project_data"]["id"]), |
| 343 | author=response["featured_project_data"]["creator"], |
| 344 | thumbnail_url="https://" + response["featured_project_data"]["thumbnail_url"][2:], |
| 345 | title=response["featured_project_data"]["title"], |
| 346 | ), |
| 347 | } |
| 348 | except Exception: |
| 349 | return None |
| 350 | |
| 351 | def unfollowers(self) -> list[User]: |
| 352 | """ |