Giter Club home page Giter Club logo

12306's Introduction

12306余票提醒

监控指定日期、车次、席别的余票情况, 有票时发送邮箱通知

1.使用

配置文件

module.exports = {
  ticket: { // 票务设置
    date: '2018-02-24',
    from: '广州南',  // 始发站
    to: '北京西', // 终到站
    purposeCodes: 'ADULT', // 票种
    seatTypes: [2, 5],  // 所要监控的席别 0:商务1:一等2:二等3:高级软卧4:软卧5:动卧6:硬卧7:软座8:硬座9:无座
    trainType: /^D\d{1,4}$/ // 列车号过滤规则(正则)
  },
  transporter: { // SMTP设置
    host: 'smtp.example.com', // 支持STMP的服务器
    port: 465,  // 端口
    secure: true, // true的话端口用465, false的话用其他
    auth: {
      user: '[email protected]', // 设置STMP的邮箱
      pass: 'yourpassword'  // 设置STMP的邮箱密码(163,qq邮箱是授权码)
    }
  },
  mailOptions: {  // 邮件内容设置
    from: '"Big Brother" <[email protected]>', // 发送者
    to: '[email protected], [email protected]', // 接受者(们, 多个用逗号隔开)
    subject: '', // 邮件主题(不用管)
    text: '', // 邮件纯文本(不用管)
    html: ''  // 邮件HTML(不用管)
  }
}
PS: mailOptions中一般来讲只要修改fromto就行了, sebjecthtml会自动生成, 如果嫌发送的邮件样式太难看, 可以自行修改源代码

运行程序

$ npm start

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.