msputup
V2EX  ›  问与答

有没有现成的,符合以下要求的监控工具

  •  
  •   msputup · Jun 21, 2016 · 3962 views
    This topic created in 3798 days ago, the information mentioned may be changed or developed.

    想要监控猫店临时上架。 {"cspuId":1000009709814710,"price":"6088.00","priceCent":608800,"skuId":3129453692878,"stock":15} 就是这里的 stock 数值。 没库存的时候是 0 上库存了,会变成库存量。(主要是页面源代码的变化,页面可能还是显示下架状态的)

    有没有可对此监控的现成工具。 最好是一分钟更新一次的。

    12 replies  •  2016-06-22 12:52:57 +08:00
    Koishi
    Koishi
    Jun 21, 2016
    1
    浏览器插件倒是有好些, 不过单独的[现成的]程序没怎么见过...
    国内说的话下载站上应该有好些, 不过安全性就是另一个问题了
    Firefox 上的 Distill Monitor 这些的感觉还挺好用的...间隔也可以自定义...
    chairuosen
    chairuosen
    Jun 21, 2016
    2
    如果有接口,自己写脚本啊
    msputup
    msputup
    OP
    Jun 21, 2016
    3
    @Koishi 感谢,我看看。
    msputup
    msputup
    OP
    Jun 21, 2016
    4
    @chairuosen 写不来啊,啥接口,就是刷新正则监控数值变化吧。
    chairuosen
    chairuosen
    Jun 21, 2016
    5
    @msputup 你那条 json 哪来的?
    msputup
    msputup
    OP
    Jun 21, 2016
    6
    @chairuosen 直接右键查看网站源代码里,生成在那了的。
    chairuosen
    chairuosen
    Jun 21, 2016
    7
    @msputup 那就只能爬网页然后解析来监控了
    lhbc
    lhbc
    Jun 21, 2016
    8
    Shell 或者 Python ,也就几分钟的事。
    以前抓 Nexus 的库存就是这样干的,有库存就发邮件。
    diggzhang
    diggzhang
    Jun 21, 2016
    9
    这个有意思,简单一点做的话, cron + python?
    msputup
    msputup
    OP
    Jun 22, 2016
    10
    @lhbc 有个参考的例子么?没有用过 shell 和 python ,得现学现卖。
    lhbc
    lhbc
    Jun 22, 2016
    11
    @msputup

    #!/bin/bash
    web_source=$(curl -s -k https://xxx)
    stock=$(echo "$web_source" | grep xxxx)

    if [ $stock -gt 0 ]
    then
    echo "Stock: $stock" | mutt -s "Stock: $stock" "[email protected]"
    fi
    msputup
    msputup
    OP
    Jun 22, 2016
    12
    @lhbc 感谢,我研究下。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1750 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:46 · PVG 12:46 · LAX 20:46 · JFK 23:46
    ♥ Do have faith in what you're doing.