分享下之前调用过的篮球即时赔率代码,用的是kotlin的
/**
* 获取 篮球即时指数.篮球全场赔率接口
* 在线接口文档:
*/
public BasketballFullOdds fetchBasketballFullOdds() {
String content = fetchString("http://test.win007.com/lq/LqOdds.aspx");
MixString partMix = new MixString(content, "$");
MixString rfMix = new MixString(partMix[2], ";");
MixString opMix = new MixString(partMix[3], ";");
MixString dxMix = new MixString(partMix[4], ";");
return new BasketballFullOdds(
rfMix.list.stream().map( it -> {
MixString oddsMix = new MixString(it);
return new BasketballYpOdds(
oddsMix[0],
oddsMix[1],
oddsMix[2],
oddsMix[3],
oddsMix[4],
oddsMix[5],
oddsMix[6],
oddsMix[7],
oddsMix[8],
oddsMix[9],
oddsMix[10]
);
}).collect(Collectors.toList()),
opMix.list.stream().map( it -> {
MixString oddsMix = new MixString(it)
return new BasketballOpOdds(