Skip to content

On deploy, update an OpenProcessing curation #1445

Open

Description

@ksen0

Increasing Access

Currently, the examples on the p5.js web editor must be manually updated, and this makes new examples not accessible/maintainable.

Most appropriate sub-area of p5.js?

Examples

Feature request details

On deployment of the main branch, using env vars to specify curation and auth, update an OpenProcesing curation via the API to include all the examples

Note that the website should still be the source of truth for examples, because the p5js website has multiple languages and OP currently does not.

Activity

  1. ksen0 commented on Jun 16, 2026

    @ksen0
    MemberAuthor

    This issue is currently reserved for CodeDay, please do not make PRs. Thanks for your understanding!

  2. Yisakor-Mirany commented on Jul 11, 2026

    @Yisakor-Mirany

    I am working on this issue, and I am from CodeDay Labs.

  3. Yisakor-Mirany commented on Jul 24, 2026

    @Yisakor-Mirany

    Hi! I'm working on this issue for CodeDay. I inspected the OpenProcessing Public API documentation and found the read endpoints for curations (GET /api/curation/{id} and GET /api/curation/{id}/sketches), but I couldn't find any documented write endpoint for updating a curation or adding sketches. Is there a private/internal endpoint or another API that this issue is intended to use?

  4. ksen0 commented on Jul 31, 2026

    @ksen0
    MemberAuthor

    Hi @Yisakor-Mirany ! Sorry for the delay in answering and the missing info. Although there is no public documentation, the endpoint does exist (and will be publicly documented soon). With thanks to OP developer Sinan who shared the info about it:

    /**
         * Add a sketch to a curation.
         * Endpoint: POST /api/curation/{id}/sketches/{visualID}
         * (Routed via routes.php to api/curation_sketch/$1/$2.)
         * Mirrors Curation_controller::submit_ajax authorization, dedup, status and
         * notification behavior.
         *
         * @apiPublic
         */
    

    Here is an example test curation I made on my own account and added a sketch to programmatically: https://openprocessing.org/curation/91135 I used POST https://openprocessing.org/api/curation/91135/sketches/2934070 with no payload and with Authentication: Bearer [token] header using my account token. Same URL with DELETE deletes the sketch.

    For working on this, please create a text curation where only owner can submit, and put your token into a secret on your fork (never share your tokens!). Curation id should also be a repo-level variable that is different for your fork, rather than hardcoded.

    Thats just for adding new sketches (unique by name) or deleting (same structure), you can use GET on curation to determine if anything needs to be added or removed; and you can update sketches with the data.

    Importantly here, the logic of the "remix" attribution should be abstracted out, so it is only defined once, but exists in both the example layout and as a comment at the top of the sketch:

    Image

    It is very important that if these sketches are uploaded to any additional account, that they are always fully correctly attributed (also during testing)! Totally fine to keep markdown to maintain links.

    Thanks for working on this, please don't hesitate to @ me here or (for a much faster response) post in the discord.p5js.org #codeday channel!

  5. Yisakor-Mirany commented on Aug 16, 2026

    @Yisakor-Mirany

    Hi! I’ve submitted the PR for the OpenProcessing synchronization work. I added the initial sync tooling, API/configuration support, attribution handling, and automated tests. I also tested the synchronization using a dry run to make sure no OpenProcessing sketches were modified unexpectedly.

    The PR includes screenshots and test results for reference. I’d appreciate any feedback or suggestions on the implementation, especially regarding the remaining create/update synchronization flow. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions