{"id":13844644,"url":"https://github.com/SaulLawliet/watchdog","last_synced_at":"2025-07-12T00:30:49.370Z","repository":{"id":15085311,"uuid":"77533668","full_name":"SaulLawliet/watchdog","owner":"SaulLawliet","description":"IF (接口/网页 有变化) THEN (提醒你)","archived":true,"fork":false,"pushed_at":"2022-10-13T07:43:34.000Z","size":365,"stargazers_count":54,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-05T17:42:42.313Z","etag":null,"topics":["monitor","scraper","watchdog"],"latest_commit_sha":null,"homepage":"","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/SaulLawliet.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}},"created_at":"2016-12-28T13:09:46.000Z","updated_at":"2023-03-19T02:39:41.000Z","dependencies_parsed_at":"2023-01-11T19:00:41.530Z","dependency_job_id":null,"html_url":"https://github.com/SaulLawliet/watchdog","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/SaulLawliet%2Fwatchdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulLawliet%2Fwatchdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulLawliet%2Fwatchdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulLawliet%2Fwatchdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaulLawliet","download_url":"https://codeload.github.com/SaulLawliet/watchdog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225772707,"owners_count":17521874,"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":["monitor","scraper","watchdog"],"created_at":"2024-08-04T17:02:50.071Z","updated_at":"2024-11-21T17:30:37.103Z","avatar_url":"https://github.com/SaulLawliet.png","language":"Ruby","funding_links":[],"categories":["Ruby","Ruby (88)"],"sub_categories":[],"readme":"# Watchdog\n\nIF (网页某区域有变化) THEN (提醒你)\n\n## 编写规则\n\n配置文件放在`fetchers`目录下\n\n### Ruby 脚本监控\n\n文件名以`.rb`结尾, 实现方式是定义一个函数, 函数内容是该脚本, 支持传递配置参数.\n\n已有规则:\n| fetcher          | 描述                                                                         | 参数             |\n|------------------|:-----------------------------------------------------------------------------|------------------|\n| bilibili-up      | B站UP主, 当前粉丝数, 获赞数等                                                | up主ID           |\n| epic-free-games  | Epic 每周免费游戏, UTC 时间每周四15点更新                                    | -                |\n| steam-free-games | (失效)Steam 免费游戏, 数据来源 steamdb.info, 依赖 tools/cloudflare-scrape.py | -                |\n| wanwang-price    | 万网域名续费价格监控                                                         | 具体域名的产品ID |\n| xueqiu-fund      | 基金收益提醒, 数据来源: xueqiu.com                                           | 编号、本金、份额 |\n\n### CSS Selectors 监控\n\n文件名以`.yaml`结尾.\n\n``` yaml\n# file: fetchers/ituring.yaml\nname: \"图灵社区 - 每周特价\"                        # 邮件标题(%s表示通配符)\nurl: \"https://www.ituring.com.cn/tag/36527\"     # 抓取的页面(%s表示通配符)\ncss_selectors: \".book-img\"                      # 抓取的节点\n```\n\n对于 `css_selectors` 如何食用, 请搭配\n[SelectorGadget](https://chrome.google.com/webstore/detail/selectorgadget/mhjhnkcfbdhnjickkkdbjoemdmbfginb).\n\n已有规则:\n| fetcher        | 描述                     |\n|----------------|:-------------------------|\n| ituring        | 图灵社区, 每周特价电子书 |\n| smzdm          | 什么值得买, 首页热门     |\n| smzdm-fenlei-x | 什么值得买, 分类         |\n| smzdm-post-x   | 什么值得买, 用户发文     |\n| smzdm-tag-x    | 什么值得买, 标签关键字   |\n| smzdm-youhui-x | 什么值得买, 商品关键字   |\n\n## 修改配置 (config.yaml)\n\n### 发送者\n\n暂时只支持邮件发送, 配置的模板已经写好, 需要修改的部分已经已经用`TODO`做了标记\n\n注意: 单元测试默认开启了`测试邮件发送`, 如已测试通过, 请修改`test_sender`的值为`false`,\n不然每次启动都会发送一次测试邮件.\n\n### 其他\n\n具体请看`config.yaml`, 可配置项包括代理配置, 用户配置, 订阅规则.\n\n## 获取并运行\n\n``` bash\ngit clone https://github.com/SaulLawliet/watchdog.git\ncd watchdog\n\n# 初始化环境\nbin/setup\n\n# 单元测试\nrake spec\n\n# 后台运行服务(内部会运行单元测试)\nbin/watchdog \u0026\n\n# 进入 irb 命令行\nbin/console\n```\n\n## 邮件截图\n\n\u003cimg src=\"screenshots/ituring.png\" width=\"400px\" /\u003e \u003cimg src=\"screenshots/ikea.png\" width=\"400px\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaulLawliet%2Fwatchdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSaulLawliet%2Fwatchdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaulLawliet%2Fwatchdog/lists"}