{"id":13880034,"url":"https://github.com/deadmanssnitch/snitcher","last_synced_at":"2025-10-06T01:01:57.478Z","repository":{"id":9094822,"uuid":"10872713","full_name":"deadmanssnitch/snitcher","owner":"deadmanssnitch","description":"Simple API client for deadmanssnitch.com","archived":false,"fork":false,"pushed_at":"2025-01-13T15:45:12.000Z","size":336,"stargazers_count":40,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-02T04:05:36.126Z","etag":null,"topics":["cron","dead-mans-snitch","monitoring","ruby"],"latest_commit_sha":null,"homepage":"https://deadmanssnitch.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deadmanssnitch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2013-06-22T21:21:44.000Z","updated_at":"2025-01-13T15:45:17.000Z","dependencies_parsed_at":"2024-06-20T23:36:43.689Z","dependency_job_id":null,"html_url":"https://github.com/deadmanssnitch/snitcher","commit_stats":{"total_commits":155,"total_committers":11,"mean_commits":"14.090909090909092","dds":0.4838709677419355,"last_synced_commit":"351d56023c826f01816ff08a90d11ef96e1e025f"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/deadmanssnitch/snitcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadmanssnitch%2Fsnitcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadmanssnitch%2Fsnitcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadmanssnitch%2Fsnitcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadmanssnitch%2Fsnitcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deadmanssnitch","download_url":"https://codeload.github.com/deadmanssnitch/snitcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadmanssnitch%2Fsnitcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524602,"owners_count":23782009,"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":["cron","dead-mans-snitch","monitoring","ruby"],"created_at":"2024-08-06T08:02:44.452Z","updated_at":"2025-10-06T01:01:52.401Z","avatar_url":"https://github.com/deadmanssnitch.png","language":"Ruby","readme":"# Snitcher\n\nSimple API client for [Dead Man's Snitch](https://deadmanssnitch.com)\n\n[![Gem Version](https://badge.fury.io/rb/snitcher.png)](http://badge.fury.io/rb/snitcher)\n[![Build Status](https://travis-ci.com/deadmanssnitch/snitcher.png?branch=master)](https://travis-ci.com/deadmanssnitch/snitcher)\n[![Code Climate](https://codeclimate.com/github/deadmanssnitch/snitcher.png)](https://codeclimate.com/github/deadmanssnitch/snitcher)\n[![Coverage Status](https://coveralls.io/repos/deadmanssnitch/snitcher/badge.png)](https://coveralls.io/r/deadmanssnitch/snitcher)\n\n![Snitches get Stitches](doc/get_them_stitches.jpg)\n\n## Usage\n\nTo check in for one of your snitches:\n\n```ruby\nSnitcher.snitch(\"c2354d53d2\")\n```\n\nYou also may provide a message with the check in:\n\n```ruby\nSnitcher.snitch(\"c2354d53d2\", message: \"Finished in 23.8 seconds.\")\n```\n\nErrors can be reported by providing the `status` option. A status of `nil`,\n`0`, or `\"\"` are all considered a success. Any other status is treated as a\nfailure.\n\n```ruby\nSnitcher.snitch(\"c2354d53d2\", status: 1)\n```\n\nThe default timeout of 5 seconds can be overridden:\n\n```ruby\nSnitcher.snitch(\"c2354d53d2\", timeout: 10)\n```\n\n## API Access\n\n### Setup\n\nInitialize the API client directly with your api key:\n\n```ruby\nrequire \"snitcher/api\"\n\nclient = Snitcher::API::Client.new(\"my_awesome_key\")\n```\n\n#### Heroku\n\nDead Man's Snitch exposes the `DEADMANSSNITCH_API_KEY` environment variable for\naccessing the API.\n\n```ruby\nrequire \"snitcher/api\"\n\nclient = Snitcher::API::Client.new(ENV[\"DEADMANSSNITCH_API_KEY\"])\n```\n\n### Listing Snitches\n\n```ruby\nclient.snitches\n```\n\nReturns an array of Snitches.\n\n### Retrieve a Single Snitch\n\n```ruby\ntoken = \"c2354d53d2\"\nclient.snitch(token)\n```\n\nReturns a Snitch.\n\n### Retrieve Snitches That Match a Set of Tags\n\n```ruby\nclient.snitches(tags: [\"critical\", \"sales\"])\n```\n\nReturns an array of Snitches.\n\n### Create a Snitch\n\nBoth `:name` and `:interval` are required. Optional attributes include `:notes`,\nand `:tags`. For a full list see [the API documentation](https://deadmanssnitch.com/docs/api/v1#creating-a-snitch).\n\n```ruby\nattributes = {\n  name: \"Nightly User Data Backups\",\n  interval: \"daily\",\n  notes: \"User login and usage data\",\n  tags: [\"users\", \"critical\"],\n}\nclient.create_snitch(attributes)\n```\n\nReturns the newly-created Snitch.\n\n### Updating a Snitch\n\nYou only need to pass the update_snitch function the attributes you want to\nchange. The rest of a Snitch's attributes will remain the same.\n\n```ruby\ntoken = \"c2354d53d2\"\nattrs = { \"name\": \"Important Nightly User Data Backups\" }\nclient.update_snitch(token, attrs)\n```\n\nReturns the edited Snitch.\n\n### Adding Tags to a Snitch\n\nThis function adds tags to a Snitch, retaining whatever tags it already has.\n\n```ruby\ntoken = \"c2354d53d2\"\ntags  = [\"spring_campaign\", \"support\"]\nclient.add_tags(token, tags)\n```\n\nReturns an array of all of the Snitch's tags.\n\n### Deleting a Tag From a Snitch\n\nThis function is for deleting a single tag from a Snitch.\n\n```ruby\ntoken = \"c2354d53d2\"\ntag = \"support\"\nclient.remove_tag(token, tag)\n```\n\nReturns an array of all of the Snitch's remaining tags.\n\n### Setting the Tags on a Snitch\n\n```ruby\ntoken = \"c2354d53d2\"\nclient.update_snitch(token, tags: [ \"production\", \"critical\" ])\n```\n\n### Removing all Tags from a Snitch\n\n```ruby\ntoken = \"c2354d53d2\"\nclient.update_snitch(token, tags: [])\n```\n\n### Pause a Snitch\n\n```ruby\ntoken = \"c2354d53d2\"\nclient.pause_snitch(token)\n```\n\nReturns a nil object.\n\n### Delete a Snitch\n\n```ruby\ntoken = \"c2354d53d2\"\nclient.delete_snitch(token)\n```\n\nReturns a nil object.\n\n## Contributing\n\nSnitcher is open source and contributions from the community are encouraged! No\ncontribution is too small. Please consider:\n\n* adding features\n* squashing bugs\n* updating documentation\n* fixing typos\n\nFor the best chance of having your changes merged, please:\n\n1. fork the project\n2. push your changes, with tests\n3. submit a pull request with at least one animated GIF\n\n## Thanks\n\nA big thank you to [Randy Schmidt](https://github.com/r38y) for dreaming up\nDead Man's Snitch in the first place and for\n[entrusting](http://r38y.com/dead-mans-snitch-sold) its future to Collective\nIdea.\n\n## Copyright\n\nSee [LICENSE.txt](LICENSE.txt) for details.\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadmanssnitch%2Fsnitcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeadmanssnitch%2Fsnitcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadmanssnitch%2Fsnitcher/lists"}