Git Product home page Git Product logo

Comments (2)

Xu22Web avatar Xu22Web commented on August 29, 2024

@q8195438
如果没有其他报错的话,解决如下(参考README.md):

  1. 确保运行环境已配置完成
    1. node_module 模块依赖
    2. google-chrome 浏览器及Pup配置( src/config/pup.ts)中的executablePath字段以及headless字段(true 非图形界面,false 图形界面)
    3. linux 环境安装的puppeteer依赖,windows 忽略此项
  2. 配置定时任务的时间,进行Push配置( src/config/push.ts)
     /**
     * @description 如开启微信推送,填写自己的token,否则无需填写
     */
    token: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
    /**
     * @description 如开启微信推送,加自己为好友的token,否则无需填写
     */
    toToken: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
    // list 是一个任务数组,可以添加不同时间段对应`cron`表达式设置定时任务
    // 如开启微信推送,需要填写`nick`, `token` 以及`cron`,否则,仅需修改`cron`表达式
    list: [
    {
      nick: '推送昵称',
      token: '推送Token',
    // 例如,这里的 '0 0 12 * * ?'表示每天12时0分0秒开始执行一个任务
      cron: '0 0 12 * * ?',
    },
    ]
    # 关于`node-schedule`的定时任务表达式
     *    *    *    *    *    *
    ┬    ┬    ┬    ┬    ┬    ┬
    │    │    │    │    │    │
    │    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
    │    │    │    │    └───── month (1 - 12)
    │    │    │    └────────── day of month (1 - 31)
    │    │    └─────────────── hour (0 - 23)
    │    └──────────────────── minute (0 - 59)
    └───────────────────────── second (0 - 59, OPTIONAL)
    
  3. 运行
    pnpm start
    
  4. 到达预定运行时间,扫码登陆
    1. 未开启微信推送

      注意:Pup配置( src/config/pup.ts)中的headless字段(true 非图形界面,false 图形界面)

      1. 对于图形界面,可直接扫码登陆
      2. 对于非图形界面,扫描src/qrcode目录下的二维码
    2. 开启微信推送,保存公众发送消息里的二维码,扫码登陆

from tech-study-node.

Xu22Web avatar Xu22Web commented on August 29, 2024

另外,在后期,我打算将设定时间部分拿出来,将任务时间设定独立于推送

from tech-study-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.