{"id":30545460,"url":"https://github.com/clove3am/bash-url-watch","last_synced_at":"2026-04-18T13:31:56.650Z","repository":{"id":311662872,"uuid":"1041705951","full_name":"clove3am/bash-url-watch","owner":"clove3am","description":"A simple, lightweight Bash script to monitor the output of commands (like fetching a URL) for changes. It's designed to be a minimalist tool with few dependencies for basic monitoring tasks.","archived":false,"fork":false,"pushed_at":"2025-08-25T19:38:34.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-25T21:29:21.282Z","etag":null,"topics":["automation","bash","monitoring","urlwatch","webpage"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/clove3am.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-08-20T22:31:52.000Z","updated_at":"2025-08-25T19:38:37.000Z","dependencies_parsed_at":"2025-08-25T21:29:28.077Z","dependency_job_id":"877edc6e-b11d-44ce-9e47-a15b365229c5","html_url":"https://github.com/clove3am/bash-url-watch","commit_stats":null,"previous_names":["clove3am/bash-url-watch"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/clove3am/bash-url-watch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clove3am%2Fbash-url-watch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clove3am%2Fbash-url-watch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clove3am%2Fbash-url-watch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clove3am%2Fbash-url-watch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clove3am","download_url":"https://codeload.github.com/clove3am/bash-url-watch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clove3am%2Fbash-url-watch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["automation","bash","monitoring","urlwatch","webpage"],"created_at":"2025-08-28T00:25:46.241Z","updated_at":"2026-04-18T13:31:56.644Z","avatar_url":"https://github.com/clove3am.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bash-url-watch\n\nA simple, lightweight Bash script to monitor the output of commands (like fetching a URL) for changes. It's designed to be a minimalist tool with few dependencies for basic monitoring tasks.\n\n\u003e Built partly with the help of [Google Gemini](https://gemini.google.com)\n\n### Inspiration\n\nThis script is a minimalist, Bash-only tool inspired by the powerful and feature-rich Python-based [urlwatch](https://github.com/thp/urlwatch) by Thomas Perl. If you need more advanced features like various reporters (email, push notifications), complex filters, and extensive job types, `urlwatch` is an excellent choice. `bash-url-watch` aims for simplicity and minimal dependencies.\n\n## Features\n\n- **Monitors Command Output**: Tracks changes in the output of any shell command.\n- **Simple YAML Configuration**: Define your jobs in an easy-to-read YAML file.\n- **Variable Substitution**: Use placeholders like `%%%VAR_NAME%%%` in commands, defined in an optional `globals.conf` for reusability and security (e.g., for API keys).\n- **Reserved Variables**: Access internal script data like `%%%SCRIPT_IDENTITY%%%` (e.g., `bash-url-watch v0.5.0`) for use in commands.\n- **Colored Diff**: Shows a clear, colored `diff` when changes are detected.\n- **XDG Compliant**: Follows the XDG Base Directory Specification for configuration and state files.\n- **Minimal Dependencies**: Requires only `diff` and `yq`.\n- **Summary Report**: Provides a clean summary of what has changed after running.\n\n## Requirements\n\n- `diff` (from `diffutils`)\n- [yq](https://github.com/mikefarah/yq/) (a portable command-line YAML processor)\n\n## Installation\n\n1. Download the script:\n\n```bash\nsudo curl -o /usr/local/bin/bash-url-watch https://raw.githubusercontent.com/clove3am/bash-url-watch/main/bash-url-watch\n```\n\n2. Make it executable:\n\n```bash\nchmod +x /usr/local/bin/bash-url-watch\n```\n\n## Configuration\n\nThe script uses two configuration files, both located in `~/.config/bash-url-watch/`.\n\n1. **Create the configuration directory:**\n\n    ```bash\n    mkdir -p ~/.config/bash-url-watch/\n    ```\n\n### Main Config: `urls.yaml`\n\nThis is the main file where you define the jobs to be monitored.\n\n1. **Create the configuration file `urls.yaml`:**\n\n    ```bash\n    touch ~/.config/bash-url-watch/urls.yaml\n    ```\n\n2. **Add your jobs to the file.** The file should contain a list of objects, where each object has a `name` and a `command`.\n\n    **Example `urls.yaml`:**\n\n    ```yaml\n    name: Example.com\n    command: curl -fsS 'https://example.com'\n    ---\n    name: Arch Linux News\n    command: curl -fsS 'https://archlinux.org/' |  xq -q '.article-content \u003e p'\n    ---\n    name: Check API with Custom User-Agent\n    command: curl -fsSA %%%SCRIPT_IDENTITY%%% %%%MY_API_URL%%%\n    ```\n\n### Optional Globals Config: `globals.conf`\n\nThis optional file allows you to define variables that can be substituted into the `command` field of your jobs. This is ideal for reusing values or for keeping secrets like API keys out of your main `urls.yaml` file.\n\n1. **Create the globals file `globals.conf`:**\n\n    ```bash\n    touch ~/.config/bash-url-watch/globals.conf\n    ```\n\n2. **Add your variables in a `KEY=\"VALUE\"` format.**\n\n    **Example `globals.conf`:**\n\n    ```bash\n    MY_API_URL=\"https://api.service.com/v1/status\"\n    API_KEY=\"abc123def456-your-secret-token\"\n    ```\n\n## Usage\n\nThe script stores the state (the last known output of each command) in the `~/.local/state/bash-url-watch/` directory.\n\n| Command                                          | Description                                              |\n| ------------------------------------------------ | -------------------------------------------------------- |\n| `bash-url-watch`                                 | Run all jobs and report on changes.                      |\n| `bash-url-watch --list` or `-l`                  | List all configured jobs with their numbers.             |\n| `bash-url-watch --check \u003cnum\u003e` or `-k \u003cnum\u003e`     | Run a specific job by its number from the list.          |\n| `bash-url-watch --all` or `-a`                   | Show output for all jobs, even if there are no changes.  |\n| `bash-url-watch --no-summary`                    | Hide the final summary report.                           |\n| `bash-url-watch --no-color` or `-n`              | Disable color output.                                    |\n| `bash-url-watch --clean`                         | Remove old state files for jobs no longer in the config. |\n| `bash-url-watch --urls \u003cfile\u003e` or `-u \u003cfile\u003e`    | Specify a custom path to your `urls.yaml` file.          |\n| `bash-url-watch --globals \u003cfile\u003e` or `-c \u003cfile\u003e` | Specify a custom path to your `globals.conf` file.       |\n| `bash-url-watch --completion`                    | Generate the bash completion script.                     |\n| `bash-url-watch --help` or `-h`                  | Show the help message.                                   |\n| `bash-url-watch --version` or `-v`               | Show the script version.                                 |\n\n### Example Cron Job\n\nTo run the script automatically, you can set up a cron job. Using `--no-color` and `--no-summary` is recommended to prevent clutter in your cron logs.\n\nFor example, to run it every 30 minutes:\n\n```\n*/30 * * * * /usr/local/bin/bash-url-watch --no-color --no-summary\n```\n\n## Contributing\n\nContributions to improve the script are welcome! Please feel free to submit issues or pull requests on the project's repository.\n\n## License\n\nThis script is released under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclove3am%2Fbash-url-watch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclove3am%2Fbash-url-watch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclove3am%2Fbash-url-watch/lists"}