Dazzle is a helper library for Snazzle that helps get things from ScratchDB and the Scratch API.
Formats a timestamp to a human-readable format.
timestamp
(str): The timestamp to format.
Sets the server host for the application.
host
(str): The host to set.
Force ScratchDB usage.
value
(bool): True to force ScratchDB usage, False otherwise.
Enable Replit mode for Snazzle usage on Replit.
value
(bool): True to enable Replit mode, False otherwise.
Force proxy usage for Snazzle.
value
(bool): True to force proxy usage, False otherwise.
Removes duplicates from a list.
input_list
(list): The list to remove duplicates from.
Returns:
- list: A list that is a copy of
input_list
, but with duplicates removed.
Gets topics in a subforum from ScratchDB.
category
(str): The category to retrieve topics from.page
(int): The page number of topics to retrieve.
Returns:
- dict: A dictionary containing the error status and topics.
Gets information about a forum post from ScratchDB.
post_id
(str): The ID of the post to retrieve information for.
Returns:
- dict: Information about the forum post.
Gets the author of a forum topic.
post_id
(str): The ID of the post to retrieve the author for.
Returns:
- str: The author of the forum topic.
Gets information about a project from ScratchDB.
project_id
(str): The ID of the project to retrieve information for.
Returns:
- dict: Information about the project.
Gets comments for a project.
project_id
(str): The ID of the project to retrieve comments for.
Returns:
- dict: Comments for the project.
Gets a user's status from Ocular.
username
(str): The username of the user.
Returns:
- dict: User's status information.
Gets a user's status from Aviate.
username
(str): The username of the user.
Returns:
- str: User's status.
Initializes the database.
Retrieves the featured projects from the Scratch API.
Returns:
- dict: Featured projects.
Gets data about a topic from ScratchDB.
topic_id
(str): The ID of the topic to retrieve data for.
Returns:
- dict: Topic data.
Gets trending projects from the Scratch API.
Returns:
- dict: Trending projects.
Gets posts for a topic.
topic_id
(str): The ID of the topic to retrieve posts for.page
(int): The page number of posts.order
(str): The order of posts (oldest or newest).
Returns:
- dict: Topic posts.
Gets the profile picture URL for a user.
username
(str): The username of the user.size
(int): The size of the profile picture.
Returns:
- str: Profile picture URL.
Gets the redirect URL for Scratch Auth.
Returns:
- str: Redirect URL.
Logs in a user with the provided code.
code
(str): The authentication code.
Returns:
- str: Session ID.
Checks if the token matches the user.
token
(str): The token to check.
Returns:
- list: List of matching users.
Searches for projects.
q
(str): The query string.
Returns:
- dict: Search results.
Gets data about a studio.
id
(str): The ID of the studio.
Returns:
- dict: Studio data.
Gets comments for a studio.
id
(str): The ID of the studio.
Returns:
- None