I am glad to share a python script today about the statistics and downloads of the workers who are working(prefer to say making money )with populor protocal stratum for digit currency in the main domestic website such as f2pool.com.
很高兴今天分享一个关于统计和下载矿工数据的python脚本, 针对国内主流矿池的数据做分析, 挖矿的协议也是主流协议stratum
As we can see, there is an enter URL for these main pools "api.xxx.com"and it can download the very initial source that we can probably count on.Because of that, we have the opportunity to try to analyze the data downloaded from website and have some ideas probably about our next code.
我们可以根据一个URL下载和分析数据,然后根据它来写脚本.
The following is the raw source downloaded from web. It is totally JSON format ,and, from the key like 'workers' in it, a coding plan may be seems easy.
下面是从网站下载的JSON格式的数据,键值workers可以让我们找到矿工的具体信息.
'value_today': 30827.63090590282, 'worker_length': 15, 'worker_length_online': 15, 'workers': [['number1100700', 0, 0, 0, 0, 0, '2021-01-05T07:50:43.657884Z', False, 0], ['number1100701', 4222124650659, 7505999378950, 187649984473, 587156801418428416, 5348024557502464, '2021-01-06T09:04:52.714875Z', False, 0],
We download and print the raw workers' data like this:
我们可以像这样下载和打印矿工数据: