Skip to content

Enhancement: Integrate ClickUp API for Dynamic Sponsored Event Stats #798

@kjaymiller

Description

@kjaymiller

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

  1. New Module: Create clickup_client.py to 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.
  2. App Update: Modify app.py to integrate the client.

    • Check for CLICKUP_API_TOKEN and CLICKUP_LIST_ID environment variables.
    • If present, use clickup_client to fetch the count.
    • If missing or if the API call fails, fall back to the existing local calculation method.
  3. Refactor: Improve the existing local counting logic using itertools for 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions