MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / featured_data

Method featured_data

scratchattach/site/user.py:332–349  ·  view source on GitHub ↗

Returns: dict: Gets info on the user's featured project and featured label (like "Featured project", "My favorite things", etc.)

(self)

Source from the content-addressed store, hash-verified

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 """

Callers 3

__rich__Method · 0.95
test_userFunction · 0.80

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by 1

test_userFunction · 0.64