{"id":18614994,"url":"https://github.com/andrewjbateman/html-js-websockets","last_synced_at":"2025-11-03T03:30:32.100Z","repository":{"id":47961813,"uuid":"374541983","full_name":"AndrewJBateman/html-js-websockets","owner":"AndrewJBateman","description":":clipboard: Simple HTML \u0026 Javascript app using Websockets to show data from the Binance financial info. website","archived":false,"fork":false,"pushed_at":"2022-07-26T19:33:00.000Z","size":501,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-27T02:45:11.698Z","etag":null,"topics":["binance-api","cryptocurrency","html5","javascript","websockets-client"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-07T05:12:07.000Z","updated_at":"2022-09-28T16:00:10.000Z","dependencies_parsed_at":"2022-09-17T03:51:02.397Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/html-js-websockets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fhtml-js-websockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fhtml-js-websockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fhtml-js-websockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fhtml-js-websockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/html-js-websockets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239406450,"owners_count":19633024,"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":["binance-api","cryptocurrency","html5","javascript","websockets-client"],"created_at":"2024-11-07T03:27:47.053Z","updated_at":"2025-11-03T03:30:32.057Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: HTML-JS-Websockets\n\n* HTML-Javascript app using Websockets to connect to the [Binance](www.binance.com) web server and display dynamic financial data.\n* * **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/html-js-websockets?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/html-js-websockets?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/html-js-websockets?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/html-js-websockets?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [General info](#general-info)\n* [Screenshots](#screenshots)\n* [Technologies](#technologies)\n* [Setup](#setup)\n* [Features](#features)\n* [Status](#status)\n* [Inspiration](#inspiration)\n* [Contact](#contact)\n\n## :books: General info\n\n* Cryptocurrency data received from [Binance](www.binance.com)\n\n## :camera: Screenshots\n\n![Example screenshot](./img/list.png).\n\n## :signal_strength: Technologies\n\n* [HTML5](https://html.spec.whatwg.org/) markup language\n* [Websockets API](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) communication session\n* [Binance Websocket Streams](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) base endpoint: wss://stream.binance.com:9443\n\n## :floppy_disk: Setup\n\n* Display the HTML file using a live server such as the [VS Code Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer).\n* The template price data updates automatically due to the Websockets communication channel [onmesssage event handler](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onmessage).\n\n## :computer: Code Examples\n\n* extract from `app.js` to assign [innertext](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText) to HTML elements.\n\n```javascript\n// extract stock symbol\n// add stock name to stockStreams array if not there already then display name, volume traded and close price\nconst handleStock = (stock) =\u003e {\n\tconst stockStream = stock.s // e.g. RNDRBUSD\n\tconst stockStreamClose = stock.c // close price\n\n\tif (stockStreams.indexOf(stockStream) === -1) {\n\t\tdocument.getElementById('stockStreams').innerHTML += '\u003cbr/\u003e' + stockStream + ': \u003cspan id=\"stockStream_' + stockStream + '\"\u003e\u003c/span\u003e' + ': \u003cspan id=\"stockStreamClose' + stockStream + '\"\u003e\u003c/span\u003e';\n\t\tstockStreams.push(stockStream);\n\t\tdocument.getElementById('sumStreams').innerText = stockStreams.length;\n\t}\n\tdocument.getElementById('stockStream_' + stockStream).innerText = parseFloat(stock.v).toFixed(0);\n\tdocument.getElementById('stockStreamClose' + stockStream).innerText = parseFloat(stock.c).toFixed(2);\n}\n```\n\n## :cool: Features\n\n* Websockets are easy to use\n\n## :clipboard: Status \u0026 To-do list\n\n* Status: Working\n* To-do: Expand data shown and convert to tqble\n\n## :clap: Inspiration\n\n* [Morgan Page: Real-Time Crypto Prices using the Binance API with JavaScript \u0026 Websockets](https://www.youtube.com/watch?v=XXuUNZIQUVA)\n\n## :file_folder: License\n\n* N/A\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fhtml-js-websockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fhtml-js-websockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fhtml-js-websockets/lists"}