Всем привет!
Поскольку новогодний маскарад цветов и званий был официально объявлен, скоро появится куча псевдосмешных постов от псевдонутелл. Конечно, какие-то из них могут быть смешными (особенно, если это явление происходит в обратную сторону), но многим это уже может надоесть. Это перестало быть смешным, и теперь это обычно просто раздражает.
Поэтому я решил написать скрипт, который будет показывать правильные цвета и звания. Я считаю, это не убивает идею маскарада (во всяком случае, не до конца): всякий, кто хочет поучаствовать в этом, может проигнорировать этот пост и по-прежнему видеть, какие цвета себе поставили другие пользователи (включая их самих). С их точки зрения ничего не меняется.
Из-за этого расширения страница будет грузиться чуть дольше, потому что придётся загрузить файл размером примерно ~1.6мб. Расширение не меняет звание на странице конкретного человека (мне было лень), но всякие цвета людей в блогах, комментариях, прямом эфире и так далее должны стать нормальными. Расширение также не трогает заставку со снежинками, потому что убивать новогоднее настроение -- это не то, чего я хочу.
UPD: я обновил расширение, теперь оно кеширует нужный файлик и не качает (теперь уже) 4 мегабайта при каждой загрузке страницы.
Всем счастливого нового года!
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.
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
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
The whole blog just became russian and now I can't get it back to english...
I'm a simple man. I see HOMAM reference, I upvote.
Bump
Thank you for this, good man.
The hero we deserve. Golovanov399 = Anti-Mage confirmed.
not anymore :)
But seriously, I just hate that I don't know what blogs are worth reading. Looking at the rank colour is a pretty good heuristic.
Nice work Golovanov399!
For some reason the chrome extension can't be installed ("CRX_REQUIRD_PROOF_MISSING"), I hope you look into it.
It seems that since several months ago chrome extensions in crx must either contain some metadata I didn't care about or be unpacked and installed manually from zip or from directory in developer mode, I don't remember. Here is a manual.
It worked, thanks!
Should work now
This application breaks when someone changes their handles and turns them into looking unrated. Is there a fix for this ?
Not anything stable I'd know about. I guess I can update the handles gist more frequently
I dont know if you might have updated something in the code but looks like the handles are fixed !
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?
https://mirror.codeforces.com/blog/entry/64131?#comment-571144
Ah, I tried to follow the manual linked in that comment previously, but turned out I missed a step (I did not unzip the file and thought I need to load the ZIP file). It worked now, thanks a lot.
its not working in firefox (linux Arch and in ubuntu as well) its enabled but it doesnt work
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.
Takes 2-3 mins to setup and works like a charm! Thanks!
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:
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)
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?
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:
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.
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).
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.
Why not working for this.
Literally read the comment you are replying to.
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).
:(
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.