Блог пользователя Golovanov399

Автор Golovanov399, 5 лет назад, перевод, По-русски

Всем привет!

Поскольку новогодний маскарад цветов и званий был официально объявлен, скоро появится куча псевдосмешных постов от псевдонутелл. Конечно, какие-то из них могут быть смешными (особенно, если это явление происходит в обратную сторону), но многим это уже может надоесть. Это перестало быть смешным, и теперь это обычно просто раздражает.

Поэтому я решил написать скрипт, который будет показывать правильные цвета и звания. Я считаю, это не убивает идею маскарада (во всяком случае, не до конца): всякий, кто хочет поучаствовать в этом, может проигнорировать этот пост и по-прежнему видеть, какие цвета себе поставили другие пользователи (включая их самих). С их точки зрения ничего не меняется.

Из-за этого расширения страница будет грузиться чуть дольше, потому что придётся загрузить файл размером примерно ~1.6мб. Расширение не меняет звание на странице конкретного человека (мне было лень), но всякие цвета людей в блогах, комментариях, прямом эфире и так далее должны стать нормальными. Расширение также не трогает заставку со снежинками, потому что убивать новогоднее настроение -- это не то, чего я хочу.

UPD: я обновил расширение, теперь оно кеширует нужный файлик и не качает (теперь уже) 4 мегабайта при каждой загрузке страницы.

Всем счастливого нового года!

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

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

Interesting! If you want to avoid downloading this huge file, you might want to use the CF API instead (example). It even seems that the "rank" field for each returned user describes their real color.

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

    I generate this file using cf API. I'm not sure that calling user info for all users from the page will work properly, because if one changes handle then api returns something strange for his old handle, for example. But maybe I'll modify this, idk

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

Guys, I'm in a train for ~16 hrs from now, and I haven't properly tested it yet, so if there are any bugs, I'll fix them later

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

The whole blog just became russian and now I can't get it back to english...

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

I'm a simple man. I see HOMAM reference, I upvote.

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

Bump

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

Nice work Golovanov399!

For some reason the chrome extension can't be installed ("CRX_REQUIRD_PROOF_MISSING"), I hope you look into it.

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

Should work now

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

This application breaks when someone changes their handles and turns them into looking unrated. Is there a fix for this ?

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

    Not anything stable I'd know about. I guess I can update the handles gist more frequently

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

      I dont know if you might have updated something in the code but looks like the handles are fixed !

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

Hmmm seems like recent versions of Chrome blocks enabling extension not installed from Chrome Web Store.

Tried to google for solutions but can't find any working one. Does anyone manage to enable it?

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

its not working in firefox (linux Arch and in ubuntu as well) its enabled but it doesnt work

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

    It is weird. My hypothesis is that either it cannot reach the required gistfile, or you are using an old version of firefox, and my js code is not compatible with older versions. Unfortunately, I do not know how to debug it.

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

Takes 2-3 mins to setup and works like a charm! Thanks!

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

The chrome extension doesn't work anymore :(( It says Package is invalid: `CRX_REQUIRED_PROOF_MISSING'.

UPD: I followed the manual posted above, and now I run into other errors instead:

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

    Unfortunately, it works on my computer, so I don't know how to debug this. But, according to your screenshot, the problem might be somewhere here. There are two fetch commands in this file, and it seems that one of them failed. You can try to just insert these urls into your browser and see if one of them fails to load even there (maybe github is blocked in your country, I'm not aware); then it will at least be clear what the problem is (and I will probably try to also publish the user rating list file somewhere else), otherwise my best assumption is that it struggles to deal with large files (however, when you tried the extension today, the file was as large as a year ago)

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

Hi, thanks for the nice extension! It seems that some people who haven't changed their handle colors seem to be shown as unrated. Most of them are quite inactive, so maybe it has to do with the cache of handles being incomplete?

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

    Hi! Yes, you are right; the API method doesn't return everyone: here is the list of everyone I got, and this is how I obtained this list:

    code

    You can try and call this method yourself to analyze it, but please don't do it too many times, as I heard that this method puts a heavy load on servers. I noticed that, for example, majk (from this comment section) is not there, and is therefore considered unrated by the extension. I reported this to Mike, but the problem is still there.

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

      Hi! Bumping this partly because other people might be looking for this extension, and partly because I'm facing an issue: some handles in the Top Rated section don't seem to have any color even though they didn't change their handles (and while it seems to be true for handles made in the last year, it also holds for some other people). Is there a way to sync the list of handles with the latest list? Not sure how the extension fetches the list of people from the gist (that seems to have been updated 12 hours ago, btw).

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

        Hi! Yes, I updated it 12 hours ago. The reason for some guys not being rendered is because I didn't set includeRetired flag in the api call that fetches all users: when I set this flag to true, the request times out. Maybe I will do something with it, but not today and hardly tomorrow.

        My plan is to somehow obtain the list of all rated users, including retired ones, and then update the list after each rated round with its participants (as opposed to downloading the whole users list after each rated round). I don't know how to safely download the list of all rated users, though. Probably I will go over all rounds one by one, obtaining the results for each round including retired participants. This request doesn't time out, but is probably still a load on codeforces, so maybe I will run this one night with some delays between queries. Do you have any other idea how I can obtain the list of all rated users?

        PS: just as I wrote it, I realized that I can just leave the color of every retired person as it is, because retired means they weren't online during last month (or 6 months or any other time period, I don't remember exactly), so they couldn't change their color. But this requires updating the extension.

»
4 месяца назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

I have updated the chrome extension (it now uses a newer manifest). fivedemands, I hope the error you wrote about is no longer there (KAN also encountered it, and now the extension works fine in his browser, well, except that inactive users are shown as unrated, but that's another issue).

»
4 месяца назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

:(

asdf

  • »
    »
    4 месяца назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    Oh no, I forgot, sorry :(

    One workaround would be to extract this crx in a directory called "antimagic" (crx is a zip zrchive afaik), go to chrome://extensions, enable developer mode, press "load unpacked" and select this folder.

    I hope to fix this issue maybe tomorrow or later. Sorry again, I don't know a thing about extensions and every year I have to restore my workflow from the previous year.