{"id":18075745,"url":"https://github.com/iluha168/obcb-api-wrapper","last_synced_at":"2026-04-19T02:03:09.632Z","repository":{"id":258986896,"uuid":"874734683","full_name":"iluha168/obcb-api-wrapper","owner":"iluha168","description":"(WebSocket) API wrapper for One Billion Checkboxes by Alula","archived":false,"fork":false,"pushed_at":"2025-03-01T10:08:59.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T11:20:31.047Z","etag":null,"topics":["api","deno","jsr","obcb","onemillioncheckboxes","ts","websocket"],"latest_commit_sha":null,"homepage":"https://jsr.io/@iluha168/obcb","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iluha168.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T11:16:32.000Z","updated_at":"2025-03-01T10:09:02.000Z","dependencies_parsed_at":"2024-11-02T14:35:11.260Z","dependency_job_id":null,"html_url":"https://github.com/iluha168/obcb-api-wrapper","commit_stats":null,"previous_names":["iluha168/obcb-api-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluha168%2Fobcb-api-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluha168%2Fobcb-api-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluha168%2Fobcb-api-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iluha168%2Fobcb-api-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iluha168","download_url":"https://codeload.github.com/iluha168/obcb-api-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393540,"owners_count":20931809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","deno","jsr","obcb","onemillioncheckboxes","ts","websocket"],"created_at":"2024-10-31T11:07:08.405Z","updated_at":"2026-04-19T02:03:09.592Z","avatar_url":"https://github.com/iluha168.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![JSR][jsr-badge]][jsr-url]\n[![Deno][deno-badge]][deno-url]\n[![TypeScript][typescript-badge]][typescript-url]\n[![CI][ci-badge]][ci-url]\n[![License: MIT][license-badge]][license-url]\n\n# An API wrapper for [One Billion Checkboxes](https://checkbox.ing)\n\nImplements 100% of [the protocol](https://checkbox.ing/proto-docs).\n\n## Examples\n```ts\n/** A bot that disables all checkboxes in a chunk and quits\n * @module\n */\nimport { Client } from \"jsr:@iluha168/obcb\";\n\n// Note: the website starts indexes from 1, while the API - from 0.\n// This would correspond to page 51 on the site.\nconst CHUNK_INDEX = 50\n\nnew Client({\n    // Called when the server has initialized our connection\n    // You can safely call API methods past this point\n    onHello(client) {\n        client.chunkRequest(CHUNK_INDEX)\n    },\n\n    // Called when a chunk has been received\n    onChunkUpdateFull(chunk) {\n        // Iterate over received checkboxes\n        for(const [i, checkbox] of chunk.boxes.entries()){\n            // If the checkbox is on, disable it\n            if(checkbox) chunk.toggle(i)\n        }\n        console.log(\"Chunk\", chunk.index, \"is now off\")\n        // Close the WebSocket once we are done\n        // This should automatically stop this script\n        chunk.client.disconnect()\n    },\n})\n// Don't forget to connect!\n.connect()\n```\nFor more examples, such as rendering the entire bitmap as a square image, visit [examples folder on GitHub](https://github.com/iluha168/obcb-api-wrapper/tree/main/examples).\n\n## Compatibility\nDepends on [WebSocket from WebAPI](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) in the global scope.\nEvery runtime that satisfies this requirement can use this library. It is possible to polyfill WebSocket in before calling `Client.prototype.connect`.\n\n[jsr-badge]: https://jsr.io/badges/@iluha168/obcb?style=flat-square\n[jsr-url]: https://jsr.io/@iluha168/obcb\n\n[deno-badge]: https://img.shields.io/badge/Deno-000000?logo=Deno\u0026logoColor=FFF\u0026style=flat-square\n[deno-url]: https://deno.com/\n\n[typescript-badge]: https://img.shields.io/badge/TypeScript-3178C6?logo=TypeScript\u0026logoColor=FFF\u0026style=flat-square\n[typescript-url]: https://www.typescriptlang.org/\n\n[ci-badge]: https://img.shields.io/github/actions/workflow/status/iluha168/obcb-api-wrapper/publish.yml?logo=github\u0026style=flat-square\n[ci-url]: https://github.com/iluha168/obcb-api-wrapper/actions/workflows/publish.yml\n\n[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\n[license-url]: /LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filuha168%2Fobcb-api-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filuha168%2Fobcb-api-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filuha168%2Fobcb-api-wrapper/lists"}