-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Summary
To provide up-to-date statistics on the homepage, we want to fetch the count of "Sponsored Events" directly from our ClickUp workspace instead of relying solely on the static _data/sponsored_events.json file.
Proposed Changes
-
New Module: Create
clickup_client.pyto handle interactions with the ClickUp API.- Function:
fetch_clickup_stats(token, list_id) - Logic: Fetch tasks from the specified list (including closed tasks) and return the count.
- Function:
-
App Update: Modify
app.pyto integrate the client.- Check for
CLICKUP_API_TOKENandCLICKUP_LIST_IDenvironment variables. - If present, use
clickup_clientto fetch the count. - If missing or if the API call fails, fall back to the existing local calculation method.
- Check for
-
Refactor: Improve the existing local counting logic using
itertoolsfor cleaner code (flattening the nested dictionary structure).
Environment Variables
CLICKUP_API_TOKEN: Personal Access Token or OAuth token.CLICKUP_LIST_ID: The ID of the ClickUp List containing the events.
Metadata
Metadata
Assignees
Labels
No labels