{"id":20820758,"url":"https://github.com/webdad/turboplayer2sockets","last_synced_at":"2026-04-21T17:33:56.071Z","repository":{"id":152505694,"uuid":"408153855","full_name":"WebDaD/turboplayer2sockets","owner":"WebDaD","description":"Tracks Turboplayer-Export-XML and presents the data with sockets.","archived":false,"fork":false,"pushed_at":"2022-08-14T13:25:10.000Z","size":410,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T16:39:26.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/WebDaD.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-19T14:48:00.000Z","updated_at":"2021-11-09T07:55:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"b28796ce-0d7a-4da8-b599-f40dcfded87f","html_url":"https://github.com/WebDaD/turboplayer2sockets","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fturboplayer2sockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fturboplayer2sockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fturboplayer2sockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebDaD%2Fturboplayer2sockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebDaD","download_url":"https://codeload.github.com/WebDaD/turboplayer2sockets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243167014,"owners_count":20247016,"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":[],"created_at":"2024-11-17T22:10:07.734Z","updated_at":"2026-04-21T17:33:51.023Z","avatar_url":"https://github.com/WebDaD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# turboplayer2sockets\n\nTracks Turboplayer-Export-XML and presents the data with sockets.\n\n## Config\n\nThe easy way is to simply create a __config.json__.\n\n- __port__: Port for the Service. (default: 3000)\n- __turboplayerxml__: Where is the xml-file. (default: /opt/turboplayer.xml)\n- __log/loglevel__: The Loglevel. (default: INFO)\n\nExample:\n\n```json\n{\n  \"port\": 3000,\n  \"turboplayerxml\": \"/opt/turboplayer.xml\",\n  \"log\": {\n    \"loglevel\":\"INFO\"\n  }\n}\n```\n\nAdditional Config from otherr packages:\n\n- Under the key __security__: \u003chttps://www.npmjs.com/package/sigmundd-security\u003e\n- Under the key __log__: \u003chttps://www.npmjs.com/package/sigmundd-log\u003e\n- Under the key __metrics__: \u003chttps://www.npmjs.com/package/sigmundd-metrics\u003e\n\n## Usage\n\nThere are two ways to get information: Sockets and a REST-API.  \n\nYou may combine both methods, e.g. loading the present element on client start\nand then listening to changes on the sockets.\n\n### Sockets\n\nWe are using [socket.io](https://socket.io/)\n\nIn your HTML-File add the following snippet before the `\u003c/body\u003e` (end body tag):\n\n```html\n\u003cscript src=\"SERVER/socket.io/socket.io.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  var socket = io();\n  socket.on('present_update', function(item) {\n    // Do something here with the new Item.\n  });\n  socket.on('error', function(item) {\n    // Some Error on the Server occured. You might want to see this. Or not. Your Play\n  });\n\u003c/script\u003e\n```\n\n### REST\n\nAnother Option is to use the REST-Paths:\n\n- `/_health`: Receive Status 200 if Server is Online\n- `/_ready`: Receive Status 200 if a present item is loaded, else 503\n- `/_version`: Backend Version as __text/plain__\n- `/_config`: Get the current config as __application/json__\n- `/present`: Load the present Item as __application/json__\n\n### Present Item\n\nThe present item consists of the following fields:\n\n- __sequence__ : The Current sequence. always `present`\n- __Show_Name__: The Name of the current show as string\n- __Presenter__: The presenter (mod) of the current show\n- __Title__: The Title of the current song\n- __Music_Performer__: The Performer of the current song\n- __Time_Duration__: The planned duration of the current song in MM:SS.fff\n- __Show_Time_Start__: The StartTime of the current show in YYYY-mm-dd HH:MM:SS.fff\n- __Show_Time_Stop__: The StopTime of the current show in YYYY-mm-dd HH:MM:SS.fff\n\n\nExample:\n\n```json\n{\n  \"sequence\": \"present\",\n  \"Show_Name\": \"Amsl Nicenstein\",\n  \"Presenter\": \"Someone does\",\n  \"Title\": \"Yarama Bastıkca\",\n  \"Music_Performer\": \"Ah! Kosmos \u0026 Özgür Yılmaz\",\n  \"Time_Duration\": \"00:04:23.000\",\n  \"Show_Time_Start\": \"2022-07-02 07:30:00.000\",\n  \"Show_Time_Stop\": \"2022-07-02 12:00:00.000\",\n}\n```\n\n## Deployment\n\nThere are two direct ways to run this microservice: native and docker  \n\n### Native\n\nJust install the npm-packages, add a config,  then run the service.\nIf the file is not created, default values from above are used:\n\n1. `npm install`\n2. ---\u003e Create config.json (see above)\n3. `node index.js`\n\n(You may opt to use some kind of process-manager, like systemd or pm2)\n\n### Docker\n\nBuild the Image, then run it.\n\n1. `docker build -t turboplayer2sockets:latest .`\n2. `docker run -d turboplayer2sockets:latest`\n\nYou may use the given _docker.sh_, which just needs some environment variables.\nIf these are not set, default values from above are used:\n\n- __T2S_PORT__: Port for the Service\n- __T2S_TURBOPLAYER_XML__: Path to Turboplayer-XML\n- __T2S_LOGLEVEL__: Loglevel for Application (DEBUG, NOTICE, INFO, WARN, ERROR, FATAL)\n\n## Telemetrics\n\n2 types of telemetrics are avaiable: logs and promethes metrics.\n\n### Logs\n\nLogs are written to STDOUT in the following Format:\n\n`YYYY-MM-DDTHH:ii:ss\\tHOST\\tturboplayer2sockets\\tLEVEL\\tMESSAGE`\n\nExample:\n\n`2021-09-19T19:26:34     LT-9410794      turboplayer2sockets     INFO    turboplayer2sockets is running on Port 3000`\n\n### Prometheus\n\nThe Metrics are reachable via REST: `/_metrics` and consist fo the following stats:\n\n- version Version of this Service\n- present_item The Item which is loaded.\n- xml_update Number of Times XML File has been updated on disk\n- present_update Number of Times Present Item has been updated\n- process_cpu_user_seconds_total Total user CPU time spent in seconds.\n- process_cpu_system_seconds_total Total system CPU time spent in seconds.\n- process_cpu_seconds_total Total user and system CPU time spent in seconds.\n- process_start_time_seconds Start time of the process since unix epoch in seconds.\n- process_resident_memory_bytes Resident memory size in bytes.\n- nodejs_eventloop_lag_seconds Lag of event loop in seconds.\n- nodejs_eventloop_lag_min_seconds The minimum recorded event loop delay.\n- nodejs_eventloop_lag_max_seconds The maximum recorded event loop delay.\n- nodejs_eventloop_lag_mean_seconds The mean of the recorded event loop delays.\n- nodejs_eventloop_lag_stddev_seconds The standard deviation of the recorded event loop delays.\n- nodejs_eventloop_lag_p50_seconds The 50th percentile of the recorded event loop delays.\n- nodejs_eventloop_lag_p90_seconds The 90th percentile of the recorded event loop delays.\n- nodejs_eventloop_lag_p99_seconds The 99th percentile of the recorded event loop delays.\n- nodejs_active_handles Number of active libuv handles grouped by handle type. Every handle type is C++ class name.\n- nodejs_active_handles_total Total number of active handles.\n- nodejs_active_requests Number of active libuv requests grouped by request type. Every request type is C++ class name.\n- nodejs_active_requests_total Total number of active requests.\n- nodejs_heap_size_total_bytes Process heap size from Node.js in bytes.\n- nodejs_heap_size_used_bytes Process heap size used from Node.js in bytes.\n- nodejs_external_memory_bytes Node.js external memory size in bytes.\n- nodejs_heap_space_size_total_bytes Process heap space size total from Node.js in bytes.\n- nodejs_heap_space_size_used_bytes Process heap space size used from Node.js in bytes.\n- nodejs_heap_space_size_available_bytes Process heap space size available from Node.js in bytes.\n- nodejs_version_info Node.js version info.\n\n## TODO\n\n- unit tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdad%2Fturboplayer2sockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdad%2Fturboplayer2sockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdad%2Fturboplayer2sockets/lists"}