ItsTHEAvro's blog

By ItsTHEAvro, 22 months ago, In English

Motivation:

I feel more motivated and competitive when I see my friends are also doing CP on Codeforces. But it's hard to check who is online or when they were online by going to each of my friend's profile. So I've written this userscript to show the last online status of my friends in the table in the My friends page.

Result:

Before
After

Usage

This userscript uses the Codeforces API to retrieve the last online time for each username in the friends list, and then calculates the elapsed time in years, months, weeks, days, and hours. As it repeats this process for every username in the friends list, there is some delay (~1 sec). I'm not quite sure how to fix that. If you have some ideas regarding this please feel free to share them with me. Also, please share your thoughts on this script. I'm interested in hearing your perspective.

  • Vote: I like it
  • +121
  • Vote: I do not like it

| Write comment?
»
22 months ago, # |
  Vote: I like it +24 Vote: I do not like it

Happy stalking fellow Competitive Programmers

»
22 months ago, # |
  Vote: I like it +7 Vote: I do not like it

I really liked it!

I think it would be better if it shows online now (in green), just like in our profiles.

  • »
    »
    22 months ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Hey! Glad that you liked it. The api returns when someone was last online in seconds. There is no discrete option like "Online now" or not. I think codeforces has a time period of 10 minutes when the user info is shown as "Online Now" but I am not sure about that. I can make the script show "Online Now" if the time is under 10 minutes but I think the current option is better for now. Thank you for your suggestion though!

    • »
      »
      »
      22 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      actually cf can mark online now even users with last online 2 days ago

  • »
    »
    22 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I use script with this option and with sorting by time