Coder Social home page Coder Social logo

Count user's message reactions about cj HOT 5 CLOSED

southclaws avatar southclaws commented on July 20, 2024
Count user's message reactions

from cj.

Comments (5)

Crayder avatar Crayder commented on July 20, 2024

Counting :rep: and :thumbsdown:/:thumbsup: should be great!

from cj.

Southclaws avatar Southclaws commented on July 20, 2024

I had some thoughts about an efficient way to do this with minimal polling and caching. Since there's no "react" gateway event as far as I know this is going to have to be manual and it's going to have some threshold of how long after a message has been created it stops being counted for reactions. From looking at general conversation, it seems about a 10 second window for messages should be fine, and we don't need to be super accurate with this sort of stuff - records can be fuzzy as I doubt users are keeping tally!

Now, on to how it could work:

Each message that comes in can have its message ID stored in a growing queue, every X seconds, all the items in this queue can have their reactions counted but only half of the items at the front of the queue are popped off (the oldest items).

This way, we have an overlapping, moving window across the dataset that ensures each message is checked twice during the window (this method has a name, I forgot it!)

I'll do a mock up of this once I've finished working on #18

(I've also removed the 'easy' tag from this as I realise it's going to need a bit more thought)

from cj.

Alasnkz avatar Alasnkz commented on July 20, 2024

I was thinking about a fun and simple little reputation system that could be used with the :rep: emote we have.

from cj.

Southclaws avatar Southclaws commented on July 20, 2024

That would be cool, I guess I completely forgot about this feature!

from cj.

NotUnlikeTheWaves avatar NotUnlikeTheWaves commented on July 20, 2024

Closed! This can be accessed via /rep [optional: emoji]. Defaults to the emoji set in the config

from cj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.