Giter Site home page Giter Site logo

zixing131 / wl520 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bpazy/wl520

0.0 2.0 0.0 167 KB

自动化完成微爱所有任务,你要做的仅仅是第一次的配置。

Home Page: https://github.com/Bpazy/wl520

License: MIT License

Dockerfile 0.77% Go 99.23%

wl520's Introduction

微爱GoGoGo Build Status

下载并使用 API接口

go get -u github.com/Bpazy/wl520/...

或前往Release下载适合您系统的版本。

示例

1. 生成配置文件 
    wl520  -s -out welove.json
2. 根据配置文件完成任务 
    wl520 -a -c welove.json

配置文件JSON格式

可以通过 wl520  -s -out welove.json 命令生成配置文件
{
  "access_token": "562949961343086-****4d8f8d23b747a3",
  "app_key": "ac5f345****344c4",
   // 阿里大于配置文件,如不需要短信提示功能,可不填
  "mobile": "18*****2070",
  "lover_mobile": "15*****8066",
  "dayu_app_key": "24****26",
  "dayu_app_secret": "817711************8711d3f5228",
  "dayu_sunlight_template_code": "SMS_********",
  "dayu_water_template_code": "SMS_********",
  "dayu_home_template_code": "SMS_********"
}

帮助

Usage of wl520:
  -a    完成所有我们的家互动任务
  -buy int
        农场购买物品ID
  -c string
        配置文件位置 (default "welove.json")
  -coin int
        农场被购买物品ID的价格上限(闭区间) (default -1)
  -log string
        日志路径 (default "welove.log")
  -out string
        生成的配置文件路径 (default "welove.json")
  -p    完成宠物任务(需要完成的时候才会消耗物品)
  -port string
        我们的家Http代理端口号 (default ":8080")
  -s    启动我们的家HTTP代理
  -t    完成爱情树任务
  -v int
        每日拜访次数 (default -1)
  -farm-sign
        农场签到

添加定时任务

1. 你可以使用Linux的工具cron:

#每30分钟检测完成我们的家所有任务和宠物任务
*/30 * * * * /usr/bin/wl520 -c /etc/welove.json -log /home/han/welove/welove_han.log -a -p

#每天凌晨1点和下午13点(两次是为了防止请求失败)检测并完成爱情树任务, 拜访20次任务, 农场签到任务
0 1,13 * * * /usr/bin/wl520 -c /etc/welove.json -log /home/han/welove/welove_han.log -t -v=20 -farm-sign

2. 或者使用本项目提供的wl520cron:
 2.1 获取wl520cron: go get github.com/Bpazy/wl520/wl520cron;
 2.2 设置wl520cron的配置文件wl520cron.json;
 2.3 运行wl520cron, wl520必须在PATH下。

wl520cron.json格式:

 [
   {
     "cron": "* */30 * * * *",
     "cmd": "-a -p"                // cmd为wl520的命令
   },
   {
     "cron": "* 0 1,13 * * *",
     "cmd": "-t -v=20 -farm-sign"
   }
 ]

cron表达式说明:

Field name   | Mandatory? | Allowed values  | Allowed special characters
----------   | ---------- | --------------  | --------------------------
Seconds      | Yes        | 0-59            | * / , -
Minutes      | Yes        | 0-59            | * / , -
Hours        | Yes        | 0-23            | * / , -
Day of month | Yes        | 1-31            | * / , - ?
Month        | Yes        | 1-12 or JAN-DEC | * / , -
Day of week  | Yes        | 0-6 or SUN-SAT  | * / , - ?

Docker

首先创建配置文件wl520.jsonwl520cron.json并存放在一个目录中,然后运行docker:

docker run -d -v /your-directory/wl520:/etc/wl520 hanziyuan08/wl520

wl520's People

Contributors

bpazy avatar

Watchers

 avatar  avatar

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.