Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function testprt(tbl)
- for k,v in pairs(tbl)do
- print(tostring(k)..": " ..tostring(v));
- end
- end
- local function Merge(tbl,tbl2)
- testprt(tbl2);
- end
- local function RawLadderRequest(leaguename,entries)
- local cnt = 0;
- local request = entries;
- local ladder = false;
- local current = false;
- local actual = entries;
- while(entries>=cnt)do
- if actual> 200 then
- actual= 200;
- end
- local req = "http://api.pathofexile.com/ladders/"..leaguename:gsub("/","%%2F").."?offset="..tostring(cnt).."&limit="..tostring(actual);
- print(req);
- cnt = cnt + actual;
- request = request - actual;
- actual = request;
- current = JSONDecode(MOD.HTTPGet(req));
- if not current then
- return nil;
- end
- if(not ladder)then
- ladder = current;
- testprt(ladder.entries);
- else
- Merge(ladder,current);
- end
- if(entries>=ladder.total)then
- return ladder;
- end
- end
- return ladder;
- end
- return RawLadderRequest("One Week HC Rampage/Beyond",300);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement