Блог пользователя moshiur.bd

Автор moshiur.bd, история, 8 лет назад, По-английски

How to extract Handles from rank-list of a specific organization/country?

Is there any way to do it with existing codeforces API? If yes, please tell me how.

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I expected some comments...

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится +2 Проголосовать: не нравится

There is no direct method in the API, however, you could load information for users through users.info method and then filter by organization or country field.

You may found useful my library for Codeforces API, written in Python. I've made a script in order to help you with your issue

  • »
    »
    8 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

    Thank you very much for your work.....

    I don't know python though.... But the Idea may help....

    There is a 5 requests/sec limit with codeforces API. tell me, how many API request actually needed to get an organization's handles?

    • »
      »
      »
      8 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      You should made at least 1 + ceil(N / 10 000) calls to the API, where N is the number of distinct user handles in all RanklistRow objects. In each call of users.info you could pass up to 10 000 handles. This may not fit into the length of the url, though, so you may need to use more calls to users.info.

      • »
        »
        »
        »
        8 лет назад, # ^ |
        Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

        Then It's not gonna work!!! I need to make a request several times in a day. Actually I need to reorder the ranklist for a specific organization . It would be great if I could extract the handles in 1-10 API requests.

        But, Now I find, input those handles manually is a better option!! :(

        • »
          »
          »
          »
          »
          8 лет назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          And what is the problem?

          1. Load all RanklistRow using contest.standings
          2. Extract all distinct user handles from row.party.members
          3. Load information for each user using users.info
          4. Reorder RanklistRow using user.organization field.