| | |
| | | |
| | | from utils import middle_api_protocol |
| | | |
| | | |
| | | # 竞价 |
| | | DABAN_TYPE_BIDDING = 8 |
| | | # 涨停 |
| | |
| | | return middle_api_protocol.request(fdata) |
| | | |
| | | |
| | | def daBanList(pidType): |
| | | data = "Order=1&a=DaBanList&st=50&c=HomeDingPan&PhoneOSNew=1&DeviceID=a38adabd-99ef-3116-8bb9-6d893c846e23" \ |
| | | f"&VerSion=5.8.0.2&Index=0&Is_st=1&PidType={pidType}&apiv=w32&Type=4&FilterMotherboard=0&Filter=0&FilterTIB=0" \ |
| | | def daBanList(pidType, page_size=50, index=0): |
| | | data = f"Order=1&a=DaBanList&st={page_size}&c=HomeDingPan&PhoneOSNew=1&DeviceID=a38adabd-99ef-3116-8bb9-6d893c846e23" \ |
| | | f"&VerSion=5.8.0.2&Index={index}&Is_st=1&PidType={pidType}&apiv=w32&Type=4&FilterMotherboard=0&Filter=0&FilterTIB=0" \ |
| | | "&FilterGem=0 " |
| | | result = __base_request("https://apphq.longhuvip.com/w1/api/index.php", data=data) |
| | | return result |
| | | |
| | | |
| | | def getLimitUpInfo(): |
| | | list_ = [] |
| | | page_size = 50 |
| | | MAX_SIZE = 150 |
| | | for i in range(0, 10): |
| | | result_str = daBanList(DABAN_TYPE_LIMIT_UP, page_size=page_size, index=len(list_)) |
| | | result = json.loads(result_str) |
| | | temp_list = result["list"] |
| | | list_ += temp_list |
| | | if len(temp_list) < page_size: |
| | | result['list'] = list_ |
| | | return json.dumps(result) |
| | | elif len(list_) > MAX_SIZE: |
| | | return json.dumps(result) |
| | | return None |
| | | |
| | | |
| | | # 市场行情-行业 |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | print(len(json.loads(daBanList(DABAN_TYPE_LIMIT_UP))["list"])) |
| | | datas = json.loads(getLimitUpInfo()) |
| | | for d in datas["list"]: |
| | | print(d[0], d[1]) |
| | | print(len(datas["list"])) |