想必大家都很想学习捡漏软件的编写,现在教大家捡漏软的逻辑,大家举一反三,相信大家可以写出优秀并且优秀的软件!!!
捡漏软逻辑解析
个人vx:http://wc.ljlju.cn/4ZGETK,有兴趣的小伙伴可以加入交流群一起学习交流。
老规矩,先上流程图
先明白其原理,在进行操作,才能更加深入的了解软件该怎么写。
这次我们学习的网址:https://www.8dian.art/
首先,我们先获取一下查询市场接口
点击价格排序,获取到市场接口,然后分析接口数据
请求URL:
https://www.8dian.art/api/nft-bcs/mark/getMarketDetailList
关键请求头:
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzaGlrb25nanV6aGVuIiwiZXhwIjoxNjgyNDg4MDI0LCJpYXQiOjE2ODE2MjQwMjQsInVzZXJJZCI6InVzZxxxxxxxxxDc3Mzh1c2VySWQiLCJ1c2VybmFtZSI6IjRkMWYwNzAyMWZjMDdhZWU2YmE0ZGE3OGIxZTE3YTVjIn0.zxeXPRBKm0uoRgN9eVgsp8957xxxxxxxxx
Content-Type: application/json
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/112.0.0.0
username: 17777777777
请求体:
{"pageNo":1,"pageSize":2,"type":1,"goodsId":"150","priceOrder":1,"dateOrder":"","uuid":3301234}
pageNo:查询的页数
pageSize:查询的数量
goodsId:商品Id
priceOrder:按照价格排序
dateOrder: 日期排序
uuid:个人账号相关信息
响应体:
{
"msg": "获取成功",
"code": "200",
"data": {
"pageNo": 1,
"pageSize": 2,
"totalDataNum": 153,
"totalPageNum": 8,
"pageData": [
{
"id": 55466,
"createAt": "2023-04-12 16:45:20",
"isDeleted": null,
"createUser": null,
"createTime": null,
"updateUser": null,
"updateTime": "2023-04-16 23:32:59",
"uuid": 1020224,
"authName": null,
"num": 1000,
"userName": null,
"headerImg": null,
"sellId": 276900,
"goodsId": 150,
"isCollection": null,
"content": null,
"image": "https://8dian-app.oss-cn-hangzhou.aliyuncs.com/goods/2023-04-08/20230408111758.png",
"name": "伙伴",
"collectionNo": "#692/1000",
"buyUuid": null,
"buyUserName": null,
"buyHeaderImg": null,
"status": 1,
"type": 1,
"price": "10.00",
"lowerPrice": null,
"collectionNum": null,
"charPrice": null,
"lockNum": null,
"isZhe": null,
"integralNum": null,
"energyNum": null,
"circulationNum": null,
"statusValue": null
},
{
"id": 55393,
"createAt": "2023-04-12 15:22:06",
"isDeleted": null,
"createUser": null,
"createTime": null,
"updateUser": null,
"updateTime": "2023-04-12 15:42:04",
"uuid": 5298105,
"authName": null,
"num": 1000,
"userName": null,
"headerImg": null,
"sellId": 276950,
"goodsId": 150,
"isCollection": null,
"content": null,
"image": "https://8dian-app.oss-cn-hangzhou.aliyuncs.com/goods/2023-04-08/20230408111758.png",
"name": "伙伴",
"collectionNo": "#65/1000",
"buyUuid": null,
"buyUserName": null,
"buyHeaderImg": null,
"status": 1,
"type": 1,
"price": "10.00",
"lowerPrice": null,
"collectionNum": null,
"charPrice": null,
"lockNum": null,
"isZhe": null,
"integralNum": null,
"energyNum": null,
"circulationNum": null,
"statusValue": null
}
]
},
"ext": null
}
我们来解析下上面的参数,当我们抓取到市场列表数据后,接下来就是对数据进行分析,分析pageData里面的数据
这里面的数据结构叫做JSON数组,[{},{},{}]是这样子类型的。然后{}加上里面包着的叫做JSON,是一种数据的格式,每个JSON里面都包含着对应商品的数据
实际的对应情况就是这个,那我们要编写捡漏软,按照下面流程编写即可。
-
查询市场、获取根据价格排序、获取前N条记录
-
循环遍历前N条数据,获取每个json中status字段的值
-
判断status==1
-
如果status==1,判断price(价格)是否<=我们设置的价格
-
价格符合条件,循环调用下单接口下单即可
这个就是捡漏软件的大致逻辑,下单接口按照上一篇文章的放大,自己手动去锁一单就能够获取到。这个网站没有加密,大家可以练练手。