{"id":13624810,"url":"https://github.com/luolongfei/bwg","last_synced_at":"2025-04-16T01:32:31.177Z","repository":{"id":97171567,"uuid":"151224297","full_name":"luolongfei/bwg","owner":"luolongfei","description":"搬瓦工补货自动提醒，写这个的初衷是想抢GIA CN2乞丐版。（昨晚凌晨三点收到提醒，已买到手）","archived":true,"fork":false,"pushed_at":"2019-01-18T02:43:14.000Z","size":56,"stargazers_count":28,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-08T13:38:18.625Z","etag":null,"topics":["bwg","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/luolongfei.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}},"created_at":"2018-10-02T08:34:32.000Z","updated_at":"2024-05-31T23:27:34.000Z","dependencies_parsed_at":"2024-01-14T07:05:14.462Z","dependency_job_id":null,"html_url":"https://github.com/luolongfei/bwg","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/luolongfei%2Fbwg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luolongfei%2Fbwg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luolongfei%2Fbwg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luolongfei%2Fbwg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luolongfei","download_url":"https://codeload.github.com/luolongfei/bwg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182451,"owners_count":21226067,"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":["bwg","php"],"created_at":"2024-08-01T21:01:46.715Z","updated_at":"2025-04-16T01:32:30.947Z","avatar_url":"https://github.com/luolongfei.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# bwg：搬瓦工补货自动提醒，写此项目的初衷是想抢GIA CN2乞丐版。\n### 前言\n前两天搬瓦工偷偷补货GIA CN2乞丐版（限量款），三网直连，简直是为我量身定做的，\n但我没有第一时间得到消息，等我到购买页面的时候发现已经卖完了卖完了……所以就有了这个项目。\n\n### 效果\n*每当搬瓦工补货，都能收到微信消息。消息内容包括VPS的基本信息和最新的优惠码。*\n\n![推送酱](https://ws1.sinaimg.cn/mw690/a4d9cbc6ly1fvu3f6bqc5j20v91jltd4.jpg)\n\n![推送酱](https://ws1.sinaimg.cn/mw690/a4d9cbc6gy1fvu34xnpepj20v91jldju.jpg)\n\n![推送酱](https://ws1.sinaimg.cn/mw690/a4d9cbc6gy1fvu35oyddnj20v91jl4n5.jpg)\n\n### 需求\n- serverChan的SendKey\n- 一台VPS\n- php版本 =\u003e 5.6（推荐使用php7以上版本，性能很不错）\n\n### 食用方法\n为了能第一时间在微信收到补货消息，我选用了serverChan的推送服务。\n#### 申请SendKey\n- 点击访问[serverChan](http://pushbear.ftqq.com/admin/#/)\n- 点击右上角的“注册\u0026登入”，接着用微信扫码登录\n- 登录成功后，来到了通道管理界面，点击“新增通道”，然后填写通道信息并新增\n- 新增完成后回到通道管理界面，点击通道的“设置”按钮，就可以看到“本通道的订阅二维码”，扫码关注（通知时所有关注了此通道二维码的人都会收到通知消息）\n- 回到通道管理界面，点击通道的“发送消息”按钮，便能看到SendKey\n\n#### 修改config.php\nok，现在有了SendKey。修改本项目的配置文件config.php。可以看到sendKey项对应着两个通道，`public_notice`用于向公众推送补货提醒，\n`report_errors`用于向开发者报告程序错误，这两个通道实际上就是两个sendKey，如果你搭建只为自己个人使用，建议将两个sendKey通道配置为同一个值。\n配置多个sendKey通道，是为了将用户和部署者区分开来，这样方便向部署者推送程序错误和补货通知，向公众只推送补货通知。接着，将products对应的pid改为你希望关注的pid，\n这个pid是搬瓦工的商品代号，我已经在配置里写了几个，按已有格式来写就好。至于每个商品对应的别名，随便取一个都成。\n\n#### Demo\n\n![推送酱](https://ws1.sinaimg.cn/large/a4d9cbc6ly1fvu38k7enhj204e042gnu.jpg)\n\n（此Demo只监听搬瓦工 CN2 GIA 乞丐版和香港月付9.9刀版本，建议你们自己搭建，按需关注）\n\n#### VPS\n*在vps上安装git和lamp环境之类的我就不多赘述了，相信玩域名和vps的人都会，不会的可以去找一键脚本。以下操作使用的是Centos7，其它操作系统命令大同小异。*\n#### clone本仓库源码\n```bash\n$ git clone https://github.com/luolongfei/bwg.git ./\n```\n#### 安装crontabs以及cronie\n```bash\n$ yum -y install cronie crontabs\n```\n#### 验证\n##### 验证crond是否安装及启动\n```bash\n$ yum list cronie \u0026\u0026 systemctl status crond\n```\n##### 验证crontab是否安装\n```bash\n$ yum list crontabs $$ which crontab \u0026\u0026 crontab -l\n```\n#### 添加计划任务\n##### 打开任务表单，并编辑\n```bash\n$ crontab -e\n\n# 任务内容如下\n# 此任务的含义是在每分钟执行一次/data/www/bwg.feifei.ooo/路径下的index.php文件\n# 注意将/data/www/bwg.feifei.ooo/替换为你自己index.php所在路径\n* * * * * cd /data/www/bwg.feifei.ooo/; php index.php \u003e/dev/null 2\u003e\u00261\n```\n##### 重启crond守护进程\n```bash\n$ systemctl restart crond\n```\n##### 查看当前crond状态\n```bash\n$ systemctl status crond\n```\n##### 查看当前计划任务列表\n```bash\n$ crontab -l\n```\n到这里就配置好了，have fun.\n有任何问题欢迎提[issues](https://github.com/luolongfei/bwg/issues)，有帮到你的话给个star如何~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluolongfei%2Fbwg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluolongfei%2Fbwg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluolongfei%2Fbwg/lists"}