{"id":17104568,"url":"https://github.com/codeanticode/hubs-connect","last_synced_at":"2025-02-22T15:31:55.749Z","repository":{"id":45810404,"uuid":"485371135","full_name":"codeanticode/hubs-connect","owner":"codeanticode","description":"A Processing library for programmatic access to Mozilla Hubs","archived":true,"fork":false,"pushed_at":"2022-06-14T11:19:50.000Z","size":7677,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T07:54:22.124Z","etag":null,"topics":["library","mozilla-hubs","processing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeanticode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"processing","custom":"https://processingfoundation.org/support"}},"created_at":"2022-04-25T12:54:03.000Z","updated_at":"2024-06-24T12:27:55.000Z","dependencies_parsed_at":"2022-08-31T20:40:36.450Z","dependency_job_id":null,"html_url":"https://github.com/codeanticode/hubs-connect","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"processing/processing-library-template-ant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeanticode%2Fhubs-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeanticode%2Fhubs-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeanticode%2Fhubs-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeanticode%2Fhubs-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeanticode","download_url":"https://codeload.github.com/codeanticode/hubs-connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240194603,"owners_count":19763158,"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":["library","mozilla-hubs","processing"],"created_at":"2024-10-14T15:37:15.690Z","updated_at":"2025-02-22T15:31:54.951Z","avatar_url":"https://github.com/codeanticode.png","language":"Java","readme":"## Hubs Connect\n\nThis is a library for the [Processing programming environment](https://processing.org/) that allows accessing a [Mozilla Hubs](https://hubs.mozilla.com/) room programatically. It is based on the [HubsCloudUtil](https://github.com/rawnsley/HubsCloudUtil) library by [Rupert Rawnsley](https://github.com/rawnsley).\n\n# Installing and using\n\nYou have to install the library manually by downloading the latest release and upacking the zip file in Processing's contributed libraries folder. The library comes with a few examples, the basic use is with the example below:\n\n```\nimport codeanticode.hubs.*;\n\nHubsConnect hubs;\n\nboolean connected = false;\nString objectId = \"\";\n\nvoid setup() {\n  size(400, 400);\n  \n  hubs = new HubsConnect(this);\n  \n  PFont font = createFont(\"Arial\", 40);\n  textFont(font);\n}\n\nvoid draw() {\n  background(0);\n  fill(255);\n  text(\"Connected: \" + connected + \"\\nmouseX: \" + mouseX + \"\\nmouseY: \" + mouseY, 40, 100);\n\n  if (connected \u0026\u0026 objectId != \"\") {\n    hubs.moveObject(objectId, map(mouseX, 0, width, -2, +2), 0, map(mouseY, 0, height, -2, +2));\n  }\n}\n\nvoid keyPressed() {\n  if (key == ' ') {\n    if (!connected) {\n      // In order to connect to an existing Hubs room, you need the room ID, which you can get from the URL:\n      // https://hubs.mozilla.com/\u003cROOM_ID\u003e\n      // and the authenticationt token, which is included in the \"Your Hubs Sign-In Link\" email from Hubs. This email contains a line like this:\n      // https://hubs.mozilla.com/?auth_origin=spoke\u0026auth_payload=\u003c...\u003e\u0026auth_token=\u003cAUTHENTICATION_TOKEN\u003e\u0026auth_topic=\u003c...\u003e\n      connected = hubs.open(\"processing-coder\", \"\u003cROOM_ID\u003e\", \"\u003cAUTHENTICATION_TOKEN\u003e\");\n      hubs.enter(0, 0, -2);\n    } else {\n      hubs.close();\n      connected = false;\n      objectId = \"\";\n    }\n  }\n}\n\nvoid mousePressed() {\n  if (connected \u0026\u0026 objectId == \"\") {\n    // Use the URL of a 3-D model from sketchfab, for example:\n    objectId = hubs.createObject(\"https://sketchfab.com/models/6511da7be4714b7a896f25ee51bf54e8\", map(mouseX, 0, width, -2, +2), 0, map(mouseY, 0, height, -2, +2));\n  }\n}\n```\n\nYou have to provide the ID of a room to open with the library, and then you can enter it with a \"puppet\" avatar that's controlled from the code, as well as creating and moving objects around. \n\n**Please note** that this library is currently at the alpha/prototype stage. It should be considered a proof of concept at this point.","funding_links":["https://github.com/sponsors/processing","https://processingfoundation.org/support"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeanticode%2Fhubs-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeanticode%2Fhubs-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeanticode%2Fhubs-connect/lists"}