{"id":15372960,"url":"https://github.com/rs/audience-meter","last_synced_at":"2025-08-30T10:35:12.021Z","repository":{"id":66040871,"uuid":"1501449","full_name":"rs/audience-meter","owner":"rs","description":"Lightweight server to mesure audience of a live event","archived":false,"fork":false,"pushed_at":"2014-03-24T23:04:30.000Z","size":361,"stargazers_count":17,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T17:50:00.635Z","etag":null,"topics":[],"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/rs.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":"2011-03-19T22:36:01.000Z","updated_at":"2014-03-24T23:04:30.000Z","dependencies_parsed_at":"2023-02-19T21:35:20.356Z","dependency_job_id":null,"html_url":"https://github.com/rs/audience-meter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rs/audience-meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Faudience-meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Faudience-meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Faudience-meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Faudience-meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rs","download_url":"https://codeload.github.com/rs/audience-meter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Faudience-meter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272839628,"owners_count":25001860,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-01T13:53:50.499Z","updated_at":"2025-08-30T10:35:11.997Z","avatar_url":"https://github.com/rs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Audience Meter: Lightweight daemon to mesure audience of a live event\n=====================================================================\n\nAudience Meter is a simple daemon written in [Node.js](http://nodejs.org) to mesure the number of users currently online. This can be used to mesure the audience of live events.\n\n## Features\n\n- Namespaces to track an unlimited number of events\n- Cross browser push notification thru [EventSource](http://dev.w3.org/html5/eventsource/) polyfill using xhr-streaming-CORS for recent browsers and flash/URLStream for older browser\n- Monitoring interface on a dedicated port\n- Spreads the load on multiple CPUs and/or multiple servers\n\n## How to use\n\nStart by running the daemon on a server, root privilege is required to let the daemon listen on ports 80:\n\n    $ sudo node audience-meter.js\n\nHere are available parameters:\n\n    Usage: audience-meter.js [options]\n\n    Options:\n\n      -h, --help                           output usage information\n      -V, --version                        output the version number\n      -d, --debug                          Log everything\n      -w, --workers \u003cnum\u003e                  Number of worker processes to spawn (default to the number of CPUs)\n      -m, --cluster-addr \u003cip:port\u003e         Use a given multicast IP:PORT to sync several instances of audience-meter\n                                           (disabled by default, prefered address is 239.255.13.37:314)\n      --max-conn-duration \u003cseconds\u003e        The maximum number of seconds a connection can stay established\n                                           (default 3600, 0 to disable)\n      --enable-uuid                        Enable connection UUID to prevent several connections with same\n                                           (EXPERIMENTAL, known to leak memory)\n      --cluster-notify-interval \u003cseconds\u003e  Interval between notifications for a node's notification (default 2 seconds\n      --cluster-node-timeout \u003cseconds\u003e     Delay after which node's namespace info will be forgotten if no notification\n                                           is recieved by a node (default 5 seconds)\n      --notify-delta-ratio \u003cratio\u003e         Minimum delta of number of members to reach before to notify listeners based\n                                           on a fraction of the current number of members (default 0.1)\n      --notify-min-delay \u003cseconds\u003e         Minimum delay between notifications (default 2)\n      --notify-max-delay \u003cseconds\u003e         Maximum delay to wait before not sending notification because of min-delta not\n                                           reached (default 25)\n      --increment-delay \u003cseconds\u003e          Number of seconds to wait before to increment the counter in order to mitigate\n                                           de/connection floods\n      --namespace-clean-delay \u003cseconds\u003e    Minimum delay to wait before to clean an empty namespace (default 60)\n      --demo-port \u003cport\u003e                   Public port on which to bind the demo server (default 8080, 0 to disable)\n      --stats-port \u003cport\u003e                  Local port on which to bind the global stats server (default 1442, 0 to disable)\n      --notification-port \u003cport\u003e           Local port on which to bind the global notification server (default 2442, 0 to disable)\n\nIn the webpage of the event, add the following javascript to join an event.:\n\n    \u003cscript src=\"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/client/jquery.audience.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n    $.audience('http://YOUR-SERVER.COM/' + namespace)\n    \u003c/script\u003e\n\nNote that you can only join a single event at a time in a single page.\n\nYou may want to report the current number of online users on the event. By default, joining an event listen for it. To get event members count when it changes, listen for incoming messages like this:\n\n    \u003cscript src=\"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/client/jquery.audience.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n    $.audience('http://{hostname}/{namespace}').progress(function(total)\n    {\n        document.getElementById(\"total\").innerHTML = total;\n    });\n    \u003c/script\u003e\n\n    Connected users \u003cspan id=\"total\"\u003e-\u003c/span\u003e\n\n\n## Monitoring Interface\n\nThe daemon listen on the 1442 port on localhost in order to let another process to dump all namespace counters for monitoring or graphing purpose. One possible usage is to update RRD files to track the evolution of the audiance over time.\n\nThe server send all namespaces and their associated info separated formated as a JSON object. Each namespace is stored in a proprety, with an object containing info on the namespace. Namespace fields are:\n\n* *created*: the UNIX timestamp of the namespace creationg time\n* *connections*: the total number of connections to the namespace since its creation\n* *members*: the current number of participents in the namespace\n\nHere is a usage example using netcat (indentation added for clarity):\n\n    $ nc localhost 1442\n    {\n        \"namespace1\":\n        {\n            \"created\":1300804962,\n            \"connections\":234,\n            \"members\":123\n        },\n        \"namespace2\":\n        {\n            \"created\":1300804302,\n            \"connections\":456,\n            \"members\":345\n        },\n        \"namespace3\":\n        {\n            \"created\":1300824940,\n            \"connections\":789,\n            \"members\":678\n        }\n    }\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 Olivier Poitrey \u003crs@dailymotion.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Faudience-meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frs%2Faudience-meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Faudience-meter/lists"}