{"id":20948292,"url":"https://github.com/raine/json-watch","last_synced_at":"2026-04-20T21:35:19.849Z","repository":{"id":66425730,"uuid":"461555519","full_name":"raine/json-watch","owner":"raine","description":"A small cli tool for monitoring JSON data for new items","archived":false,"fork":false,"pushed_at":"2022-02-24T18:57:59.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T04:43:52.482Z","etag":null,"topics":["cli","go","json"],"latest_commit_sha":null,"homepage":"","language":"Go","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/raine.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":"2022-02-20T17:02:51.000Z","updated_at":"2023-10-10T02:16:24.000Z","dependencies_parsed_at":"2023-02-22T21:45:36.327Z","dependency_job_id":null,"html_url":"https://github.com/raine/json-watch","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/raine/json-watch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fjson-watch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fjson-watch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fjson-watch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fjson-watch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raine","download_url":"https://codeload.github.com/raine/json-watch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raine%2Fjson-watch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32067616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","go","json"],"created_at":"2024-11-19T00:17:04.009Z","updated_at":"2026-04-20T21:35:19.823Z","avatar_url":"https://github.com/raine.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-watch\n\nA small cli tool for monitoring JSON data for new items.\n\n```sh\n# the first run never emits\necho '[{\"id\": 1}, {\"id\": 2}]' | json-watch test --key id\n# the second run finds two new items\necho '[{\"id\": 1}, {\"id\": 2}, {\"id\": 3}, {\"id\": 4}]' | json-watch test --key id\n{\"id\": 3}\n{\"id\": 4}\n```\n\nGo rewrite of [json-notify][json-notify].\n\n## install\n\n```sh\ngo install github.com/raine/json-watch@latest\n```\n\n## usage\n\n```sh\n\u003ccurl json etc.\u003e | json-watch \u003cname\u003e\n```\n\nTakes a list of objects as JSON through stdin.\n\nThe first execution will \"prime\" the internal watch file (stored at\n`$HOME/.config/json-watch/watches/\u003cname\u003e`) with existing items and won't print\noutput.\n\nOn further executions, unseen JSON objects in the array will be printed to\nstdout as newline delimited JSON.\n\nThe name parameter uniquely identifies an instance of json-watch usage, so if\nwatching multiple JSONs for new objects, each of the json-watch calls should\nhave a distinct name.\n\nIf the key parameter is not provided, an object's content is calculated to a\nchecksum and that is used for identification.\n\n## options\n\n```\n  -h, --help         show this help\n  -k, --key string   prop in json objects that identifies them (basically the id)\n      --version      show installed version\n```\n\n## example use\n\nThe tool works great combined with crontab, curl, [ramda-cli][ramda-cli] and\n[jsonargs][jsonargs].\n\n```sh\ncurl -s -G --data-urlencode \"q=stuff\" \"https://api.tori.fi/api/v1.1/public/ads\" \\\n  | ramda \\\n    '.list_ads' \\\n    'map (.ad)' \\\n    'filter -\u003e it.type.code is \"s\" and it.company_ad is false and it.list_price' \\\n    'map -\u003e { id: it.ad_id, message: it.subject, url: it.share_link, price: it.list_price.price_value }' \\\n  | json-watch tori-stuff --key id \\\n  | jsonargs curl -s -G \\\n    --data-urlencode \"chat_id=$chat_id\" \\\n    --data-urlencode \"text=[{{.message}}]({{.url}}) {{.price}}€\" \\\n    --data-urlencode \"parse_mode=Markdown\" \\\n    \"https://api.telegram.org/bot$telegram_bot_token/sendMessage\"\n```\n\nWhen running the pipeline periodically with crontab, new items matching search\nquery on tori.fi are sent to telegram.\n\n[jq]: https://stedolan.github.io/jq/\n[ramda-cli]: https://github.com/raine/ramda-cli\n[json-notify]: https://github.com/raine/json-notify\n[jsonargs]: https://github.com/mattn/jsonargs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraine%2Fjson-watch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraine%2Fjson-watch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraine%2Fjson-watch/lists"}