Coder Social home page Coder Social logo

jd-happy's Introduction

JD-HAPPY

注意

  1. node 版本需要支持 async/await 或者使用 --harmony 来支持
  2. 代码暂未处理错误,只保证在正常的环境下运行

前言

代码实现基于jd-autobuy

京东有代下单服务,但是会有限制,遇到些商品无法使用代下单,只能收到到货提醒,所以想实现个自动下单功能,以免剁手不成,悔恨不已

但是基本上该功能是没有什么卵用的,只不过看着简单用node实现了一下,坑比较少,毕竟前人栽树后人乘凉 😄

  • 扫码登录
  • 根据地区查询商品库存
  • 库存>0时自动下单
   在初始化浏览器……
   初始化完成,开始抓取页面
   页面抓取完成,开始分析页面
   页面参数到手,关闭浏览器

   -------------------------------------
                请求扫码
   -------------------------------------

   二维码未扫描 ,请扫描二维码
   二维码未扫描 ,请扫描二维码
   请手机客户端确认登录
   请手机客户端确认登录
   请手机客户端确认登录
   扫码成功,正在登录
   登录成功

   商品详情------------------------------
   时间:2017-10-26 19:57:51
   商品名:英特尔(Intel) i7 8700K 酷睿六核 盒装CPU处理器
   价格:3999.00
   状态:无货
   连接:http://item.jd.com/5008395.html

   商品详情------------------------------
   时间:2017-10-26 121:37:31
   商品名:英特尔(Intel) i7 8700K 酷睿六核 盒装CPU处理器
   价格:3999.00
   状态:有货
   连接:http://item.jd.com/5008395.html

   开始加入购物车
   商品已成功加入购物车!

   订单详情
   订单总金额:¥3999.00
   寄送至: 上海 浦东新区 长泰广场
   收货人:happy 123****8910

   开始下单
   下单成功,订单号4635622833
   请前往京东商城及时付款,以免订单超时取消

使用

npm install

node index.js -a 2_2830_51810_0 -g 5008395

帮助

$ node index.js

Usage: node index.js -a 地区编号 -g 商品编号

选项:
    --version       显示版本号      [布尔]
    -a, --area      地区编号        [必需]
    -g, --good      商品编号        [必需]
    -h, --help      显示帮助信息     [布尔]
    -t, --time      查询间隔ms      [必需]    [默认值: "1000"]

示例:
    node index.js -a 2_2830_51810_0 -g 5008395

缺少这些必须的选项:a, g

jd-happy's People

Contributors

shaodahong avatar

Watchers

James Cloos 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.