{"id":15592043,"url":"https://github.com/derhuerst/cd-wifi-client","last_synced_at":"2025-04-15T05:36:40.395Z","repository":{"id":57195429,"uuid":"154117451","full_name":"derhuerst/cd-wifi-client","owner":"derhuerst","description":"A client for the WiFi portal of Czech Railways trains.","archived":false,"fork":false,"pushed_at":"2023-09-19T08:17:02.000Z","size":16,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T16:21:25.238Z","etag":null,"topics":["cd","cdwifi","ceske-drahy","czech-republic","wifi"],"latest_commit_sha":null,"homepage":"https://github.com/derhuerst/cd-wifi-client","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derhuerst.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2018-10-22T09:24:54.000Z","updated_at":"2024-12-17T15:36:51.000Z","dependencies_parsed_at":"2024-11-08T09:18:23.707Z","dependency_job_id":"d373b768-3daa-47c1-a19a-5a47892c6d05","html_url":"https://github.com/derhuerst/cd-wifi-client","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fcd-wifi-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fcd-wifi-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fcd-wifi-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fcd-wifi-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derhuerst","download_url":"https://codeload.github.com/derhuerst/cd-wifi-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550620,"owners_count":21122934,"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":["cd","cdwifi","ceske-drahy","czech-republic","wifi"],"created_at":"2024-10-02T23:53:29.647Z","updated_at":"2025-04-15T05:36:40.354Z","avatar_url":"https://github.com/derhuerst.png","language":"JavaScript","funding_links":["https://patreon.com/derhuerst"],"categories":[],"sub_categories":[],"readme":"# cd-wifi-client\n\n**A client for the onboard WiFi portal of *České dráhy* (Czech Railways) trains.**\n\n[![npm version](https://img.shields.io/npm/v/cd-wifi-client.svg)](https://www.npmjs.com/package/cd-wifi-client)\n![ISC-licensed](https://img.shields.io/github/license/derhuerst/cd-wifi-client.svg)\n[![chat with me on Gitter](https://img.shields.io/badge/chat%20with%20me-on%20gitter-512e92.svg)](https://gitter.im/derhuerst)\n[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)\n\n\n## Installation\n\n```shell\nnpm install cd-wifi-client\n```\n\n\n## Usage\n\n### Acknowledging the captive portal\n\n```js\nconst {acknowledgeCaptivePortal} = require('cd-wifi-client')\n\nconst acknowledgeLegalTerms = (msg) =\u003e {\n\tconsole.log(msg)\n\treturn Promise.resolve() // we always accept\n}\n\nacknowledgeCaptivePortal(acknowledgeLegalTerms)\n.then(successMsg =\u003e console.info(successMsg))\n.catch(console.error)\n```\n\n### Getting the current position\n\n```js\nconst {fetchTrainStatus} = require('cd-wifi-client')\n\nconsole.log(await fetchTrainStatus())\n```\n\n```js\n{\n\tlatitude: 50.252175,\n\tlongitude: 14.30227,\n\taltitude: 185.5,\n\tspeed: 85,\n\tdelay: null,\n}\n```\n\n### Getting the WiFi data limit \u0026 connectivity\n\n```js\nconst {\n\tfetchWifiStatus,\n\tfetchWifiConnectivity,\n} = require('cd-wifi-client')\n\nconsole.log(await fetchWifiStatus())\nconsole.log(await fetchWifiConnectivity())\n```\n\n```js\n// WiFi status\n{\n\tauthenticated: true,\n\tid: null,\n\tclientIpAddress: '10.0.0.105',\n\tclientMacAddress: null,\n\tdataUsage: {used: 0, limit: -1, speedLimit: false, region: 'CZ'},\n}\n// WiFi connectivity\n{\n\tversion: '1.9',\n\tonline: '1',\n\tbundleid: '84105699258',\n\tbundleip: '10.3.2.1',\n\tlinks: [\n\t\t{\n\t\t\tindex: '1',\n\t\t\tdevice_type: 'ethernet',\n\t\t\tdevice_state: 'down',\n\t\t\tlink_state: 'disconnected',\n\t\t\tethernet_info: {ip: '0.0.0.0', netmask: '0.0.0.0', mode: 'dhcp'},\n\t\t},\n\t\t{\n\t\t\tindex: '102',\n\t\t\tdevice_type: 'modem',\n\t\t\tdevice_subtype: 'sierra-7710',\n\t\t\tdevice_state: 'up',\n\t\t\tlink_state: 'available',\n\t\t\trssi: '-75',\n\t\t\ttechnology: 'lte',\n\t\t\toperator_id: '23002',\n\t\t\tapninfo: 'cd-internet,-1,-1',\n\t\t\tumts_info: {net_status: '1', lac: 'FFFE', cellid: '03F3FF01'},\n\t\t},\n\t\t// …\n\t]\n}\n```\n\n\n## Related\n\n- [`sncf-wifi-portal-client`](https://github.com/derhuerst/sncf-wifi-portal-client) – Query information from the SNCF WiFi portal in French TGV trains.\n- [`wifi-on-ice-portal-client`](https://github.com/derhuerst/wifi-on-ice-portal-client) – Query information from the WifiOnICE portal in German ICE trains.\n- [`digital-im-regio-portal-client`](https://github.com/derhuerst/digital-im-regio-portal-client) – Query information from the Digital im Regio portal in German Regio trains.\n- [`live-cd-wifi-position`](https://github.com/derhuerst/live-cd-wifi-position) – Live vehicle geolocation of České dráhy (Czech Railways) trains taken from the on-board Icomera WiFi system.\n\n\n## Contributing\n\nIf you have a question or need support using `cd-wifi-client`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/cd-wifi-client/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhuerst%2Fcd-wifi-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderhuerst%2Fcd-wifi-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhuerst%2Fcd-wifi-client/lists"}