harwest-tool icon indicating copy to clipboard operation
harwest-tool copied to clipboard

Using CodeforcesApiPy and fixed Call limit

Open VadVergasov opened this issue 3 years ago • 4 comments

Using CodeforcesApiPy and waiting for some time to avoid Call Limit exceeded.

VadVergasov avatar Jan 10 '21 18:01 VadVergasov

Thanks for the proposed contribution @VadVergasov! Great to see that you already are maintaining a python wrapper for the Codeforces API. If possible, I'd like to move away from custom request calls entirely in that case by extending your project to support APIs for (1) getting tags for a given problem and (2) getting the total number of submissions page for a user. Let me know if you have the bandwidth to add these additional functionalities else I'd be happy to contribute as well.

nileshsah avatar Jan 11 '21 16:01 nileshsah

First of all, we need to wait for Codeforces API fixes, I've already contacted Mike Mirzayanov because if we need to get a lot of info in one request we need to use the POST method, not GET, but Codeforces responses 403 error on such requests.

(1) In Codeforces API we have problemset.problems method, but it will return the array of problems and we need to look throw the whole tasks to get their tags. So it will take some time. But for me, it takes about 0.5 seconds to get and convert the response to the dictionary with such look: tags["contestId"]["index"] = [tags] (2) In Codeforces API we have user.status and it will return all user's submissions, so we don't need to parse tasks page by page and this will throw away some problems, connected with a page processing (like #5 I can try to edit the current realization to modify that.

VadVergasov avatar Jan 11 '21 17:01 VadVergasov

Thanks for the update @VadVergasov! I guess I forgot to update #5 but I had briefly addressed it when I rolled out the --full-scan feature. Also, I just recalled and checked that I am no more using the get_submissions_page_count method which practically means that we can drop (2) completely. Sorry for the confusion.

nileshsah avatar Jan 11 '21 17:01 nileshsah

Updated getting tags

VadVergasov avatar Jan 20 '21 18:01 VadVergasov