{"id":15983498,"url":"https://github.com/suyashkumar/particle-logger","last_synced_at":"2025-04-04T20:33:22.887Z","repository":{"id":82739692,"uuid":"61463191","full_name":"suyashkumar/particle-logger","owner":"suyashkumar","description":"Simple tool to log and record Particle Publishes to either MongoDB (exposed via RESTful API) or CSV","archived":false,"fork":false,"pushed_at":"2016-06-19T04:49:05.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T05:13:35.692Z","etag":null,"topics":["logging","particle-logger","particle-photon","sse"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/suyashkumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2016-06-19T03:38:59.000Z","updated_at":"2018-03-13T18:31:47.000Z","dependencies_parsed_at":"2023-03-10T06:00:44.181Z","dependency_job_id":null,"html_url":"https://github.com/suyashkumar/particle-logger","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/suyashkumar%2Fparticle-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyashkumar%2Fparticle-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyashkumar%2Fparticle-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyashkumar%2Fparticle-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suyashkumar","download_url":"https://codeload.github.com/suyashkumar/particle-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247248067,"owners_count":20908087,"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":["logging","particle-logger","particle-photon","sse"],"created_at":"2024-10-08T01:42:55.365Z","updated_at":"2025-04-04T20:33:22.853Z","avatar_url":"https://github.com/suyashkumar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# particle-logger\nThis is a simple tool to capture particle \"publishes\" and save them to a MongoDB database while exposing that data via a RESTful API for consumption. As long as this tool is running, any data published to your particle account stream (under your `access_token` and for specified event names) will be recorded. If you do not want to bother with a database and the web api, this tool can be run in a CSV-only mode to log published data to a CSV on disk.\n\n## Installation\nYou must have nodejs and NPM installed. To install locally:\n\n```bash\ngit clone https://github.com/suyashkumar/particle-logger.git\ncd particle-logger\nnpm install\n```\n\nIf you wish to log to a MongoDB database, ensure that MongoDB is set up and running. If you need to set the MongoDB URI you can set it in the `config/db.js` file or by setting the `MONGO_URI` environment variable.\n\n\n\n## Config\nNote--setting the access_token and event names will be able to be done via command-line args soon. \n\nBefore logging, you must also place your Particle account's access_token in `config/config.json`. This can be found in the settings view on http://build.particle.io . It'll be something like:\n\n```javascript\n\"access_token\" : \"c51b571312b04a6884cc03eeb08b365c8ace0b15\",\n```\n(The above token and the one currently listed in `config.json` don't go anywhere, FYI)\n\nList the names of events that you want to log in the events array in `config/config.json`. The event name is the first argument the `Particle.publish` command. For example in `Particle.publish(\"temp\", \"10F\");`, \"temp\" is the event name. For example to log \"temp\" and \"air_quality\" events:\n\n```javascript\n  \"events\" : [\"temps\", \"air_quality\"]\n```\n\n## Logging \nTo log in CSV-only mode:\n\n```bash\nnode particle-log.js -c \"test.csv\"\n```\nTo log to the MongoDB database and run the RESTful API server:\n\n```bash\nnode particle-log.js\n```\nBy default the server runs on port 9000. To change that, simple set the `PORT` environemt variable by: `export PORT=9001`\n\n## RESTful API\n\n* `/api/list`: Lists all records (for all events)\n* `/api/list/:event_name`: Lists all records for the `event_name` event \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyashkumar%2Fparticle-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuyashkumar%2Fparticle-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyashkumar%2Fparticle-logger/lists"}