about
- 考虑换手机,meizu18s,3k有点贵,看一下啥时候降到 2.5以下
API
找了几个比价网,或是手机网站,有些价格不准,还有很多价格不在html里,仅发现 比一比价网的html里有明文的数字
<div class="divprice">
<div class="divprice11">
¥<font class="priceword">1999.00</font>
<span class="poptrend">
<a href="http://tool.manmanbuy.com/HistoryLowest.aspx?f=b1bjweb&url=https%3a%2f%2fdetail.tmall.com%2fitem.htm%3fid%3d637860923312%26skuId%3d4970176430824" target="_blank">
<img width="70px" height="16px" src="/images/trend.png" border="0" alt="点击查看该商品的走势图"></a>
</span></div><div class="classzdj">优惠到手价:1799<br>满减:满1980元<br>省200元</div
></div>
方案
- 在之前写好的的腾讯云函数 groovy 模板上开发
- 白天 8-20点,每一小时监控一次,记录最低价,每次底于最低价都上报
- 监控商品做到可配置,并且可以多个商品一起处理
- 提供页面对数据进行配置,初步看,数据保存在cos上的文本文件里
通知方案
- 方糖,完整好用,但是现在限制了每天5条
- wxpusher,https://wxpusher.zjiecode.com/ 测试推送没啥问题,并且也支持markdown及html,不限量
手机已买
3k买的,写不写再说吧,倒是需要监控一下机票,估计得用鞋城api
后续
总是有想要买的东西盼着降价。。哎,先写了
分析
- url:http://www.b1bj.com/s.aspx?smallclass=&ppid=&siteid=1&price1=0&price2=0&orderby=&iszy=0&key=%E9%AD%85%E6%97%8F18s&iswap=0&NotContains=&proid=0
- 数据看上去走的是慢慢买的
- 参数
- siteid=1 京东
- siteid=10 天猫
- iszy=1 只看自营和旗舰店
- key 搜索内容
- 结果不是直接写在html里的,而是js附上去的,有点恶心
<script type="text/javascript">
$('#listpro').html("<div class=\"bjline bj_0\" v='{\"bjid\":0,\"skuid\":\"100026480142\",\"sitename\":\"京东商城\",\"price\":\"2899\"}'><div class='divpic'><div class=\"proPickuan\"><a href=\"https://c.duomai.com/track.php?site_id=134541&aid=61&euid=&t=https%3a%2f%2fitem.jd.com%2f100026480142.html\" target=\"_blank\"><img onerror=\"this.src='http://b1bj.com/images/nopic.png'\" src=\"http://img12.360buyimg.com/n7/jfs/t1/211105/27/20137/79442/625007ecE03583e9c/0d45dd78d4d96719.jpg\" class='sppicclass'></a><span class=\"imgmid\"></span></div></div><div class='divtitle'><div><a href=\"https://c.duomai.com/track.php?site_id=134541&aid=61&euid=&t=https%3a%2f%2fitem.jd.com%2f100026480142.html\" target=\"_blank\" class=\"f14sc\"><font color=\"red\">魅族</font> <font color=\"red\">18</font><font color=\"red\">s</font> 8GB+128GB 踏雪 骁龙888+ 2K曲面屏 6400W高清三摄 支持36W快充 5G手机</a></div><div class='divcomment2'><a href=\"https://c.duomai.com/track.php?site_id=134541&aid=61&euid=&t=https%3a%2f%2fitem.jd.com%2f100026480142.html\" target=\"_blank\" class=\"f12comment\">有<b>16774</b>人评论</a></div><div class='divlogo'><img src=\"http://b1bj.com/images/sitelogo/1.png\" border='0' align='absmiddle' > 京东商城 (魅族京东自营旗舰店 )</div></div><div class='divprice'><div class='divprice11'>¥<font class='priceword'>2899.00</font><span class=\"poptrend\"> <a href=\"http://tool.manmanbuy.com/HistoryLowest.aspx?f=b1bjweb&url=https%3a%2f%2fitem.jd.com%2f100026480142.html\" target=\"_blank\"><img width=\"70px\" height=\"16px\" src=\"/images/trend.png\" border=\"0\" alt=\"点击查看该商品的走势图\"></a></span></div><div class='classzdj'>优惠到手价:2799<br />优惠券:满880减100</div></div></div><div class='clear'></div><div class=\"bjline bj_0\" v='{\"bjid\":0,\"skuid\":\"100026761906\",\"sitename\":\"京东商城\",\"price\":\"2899\"}'><div class='divpic'><div class=\"proPickuan\"><a href=\"https://c.duomai.com/track.php?site_id=134541&aid=61&euid=&t=https%3a%2f%2fitem.jd.com%2f100026761906.html\" target=\"_blank\"><img onerror=\"this.src='http://b1bj.com/images/nopic.png'\" src=\"http://img11.360buyimg.com/n7/jfs/t1/136259/33/25898/90149/624d06b8E7fad0f68/e411e0f62647aacd.jpg\" class='sppicclass'></a><span class=\"imgmid\"></span></div></div><div class='divtitle'><div><a href=\"https://c.duomai.com/track.php?site_id=134541&aid=61&euid=&t=https%3a%2f%2fitem.jd.com%2f100026761906.html\" target=\"_blank\" class=\"f14sc\"><font color=\"red\">魅族</font> <font color=\"red\">18</font><font color=\"red\">s</font> 8GB+128GB 独角兽 EVO 骁龙888+ 2K曲面屏 6400W高清三摄 支持36W快充 5G手机</a></div><div class='divcomment2'><a href=\"https://c.duomai.com/track.php?site_id=134541&aid=61&euid=&t=https%3a%2f%2fitem.jd.com%2f100026761906.html\" target=\"_blank\" class=\"f12comment\">有<b>16535</b>人评论</a></div><div class='divlogo'><img src=\"http://b1bj.com/images/sitelogo/1.png\" border='0' align='absmiddle' > 京东商城 (魅族京东自营旗舰店 )</div></div><div class='divprice'><div class='divprice11'>¥<font class='priceword'>2899.00</font><span class=\"poptrend\"> <a href=\"http://tool.manmanbuy.com/HistoryLowest.aspx?f=b1bjweb&url=https%3a%2f%2fitem.jd.com%2f100026761906.html\" target=\"_blank\"><img width=\"70px\" height=\"16px\" src=\"/images/trend.png\" border=\"0\" alt=\"点击查看该商品的走势图\"></a></span></div><div class='classzdj'>优惠到手价:2799<br />优惠券:满880减100</div></div></div><div class='clear'></div></div>");
</script>
编码
- 待续