MCPcopy Index your code
hub / github.com/adyzng/go-jd

github.com/adyzng/go-jd @v1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0 ↗ · + Follow
38 symbols 103 edges 3 files 31 documented · 82% updated 4y agov1.0 · 2017-12-05★ 17512 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go-AutoBuy

最近在学习Golang,路转粉。

拿Golang重写了下Python版jd-autobuy

登陆

京东二维码扫码登陆,保存cookie,无需二次登陆。

第三方库

  • clog: Clog is a channel-based logging package for Go.
  • goquery: A little like that j-thing, only in Go.
  • mahonia: Character-set conversion library implemented in Go.
  • go-simplejson: A Go package to interact with arbitrary JSON.

Example

Usage 
  -area string                                                                      
        ship location string, default to Beijing (default "1_72_2799_0")            
  -goods string                                                                     
        the goods you want to by, find it from JD website.                          
        Single Goods:                                                               
          2567304(:1)                                                               
        Multiple Goods:                                                             
          2567304(:1),3133851(:2)                                                   
  -order                                                                            
        submit the order to JingDong when get the Goods.                            
  -period int                                                                       
        the refresh period when out of stock, unit: ms. (default 500)               
  -rush                                                                             
        continue to refresh when out of stock.                                      
go run autobuy.go -goods 531065:2 -order

2017/06/27 16:55:13 [ INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017/06/27 16:55:13 [ INFO] 无需重新登录
2017/06/27 16:55:13 [ INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017/06/27 16:55:13 [ INFO] 购物车详情>
2017/06/27 16:55:14 [ INFO] 购买  数量  价格      总价      商品
2017/06/27 16:55:14 [ INFO]  +    2     ¥7.90     ¥15.80    【京东超市】绿箭(DOUBLEMINT)无糖薄荷糖原味薄荷味35粒23.8g单...
2017/06/27 16:55:14 [ INFO]  -    1     ¥1199.00  ¥1199.00  联想(ThinkVision)X24 23.8英寸纤薄超窄边框IPS屏显示器
2017/06/27 16:55:14 [ INFO]  +    1     ¥21.00    ¥21.00    王小波:沉默的大多数(2014版)
2017/06/27 16:55:14 [ INFO]  -    1     ¥59.00    ¥59.00    心匠 NanoFixit纳诺 纳米液态膜 创意手机膜 液体手机膜 通用于iPh...
2017/06/27 16:55:14 [ INFO] 总数: 3
2017/06/27 16:55:14 [ INFO] 总额: ¥36.80
2017/06/27 16:55:16 [ INFO] 编号: 531065, 库存: 有货, 价格: 7.90, 链接: https://cart.jd.com/gate.action?pid=531065&pcount=1&ptype=1
2017/06/27 16:55:16 [ INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017/06/27 16:55:16 [ INFO] 购买商品: 531065
2017/06/27 16:55:18 [ INFO] 成功加入进购物车 2 个 【京东超市】绿箭(DOUBLEMINT)无糖薄荷糖原味薄荷味35粒23.8g单...
2017/06/27 16:55:18 [ INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017/06/27 16:55:18 [ INFO] 订单详情>
2017/06/27 16:55:19 [ INFO] 总金额: ¥36.80
2017/06/27 16:55:19 [ INFO]  运费: ¥6.00
2017/06/27 16:55:19 [ INFO] 应付款: ¥42.80
2017/06/27 16:55:19 [ INFO] 收货人: **** 188********
2017/06/27 16:55:19 [ INFO] 寄送至: 北京 **********************
2017/06/27 16:55:19 [ INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017/06/27 16:55:19 [ INFO] 提交订单>
2017/06/27 16:55:20 [ INFO] 下单成功,订单号:593*******16

Core symbols most depended-on inside this repo

Get
called by 17
core/cookies.go
getResponse
called by 6
core/jingdong.go
applyCustomHeader
called by 4
core/jingdong.go
truncate
called by 2
core/jingdong.go
runCommand
called by 2
core/jingdong.go
stockState
called by 2
core/jingdong.go
Clean
called by 2
core/cookies.go
parseGoods
called by 1
autobuy.go

Shape

Method 24
Function 8
Struct 5
TypeAlias 1

Languages

Go100%

Modules by API surface

core/jingdong.go25 symbols
core/cookies.go10 symbols
autobuy.go3 symbols

For agents

$ claude mcp add go-jd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page