Forem Creators and Builders 🌱

Ido Shamun
Ido Shamun

Posted on

Get unique reactions from Forem's API

Hi!

I'm looking at the Forem's API specifically for building a DEV.to integration. I noticed that the article object has two fields related to two reactions: positive_reactions_count and public_reactions_count. I'm not sure what's the difference between the two, but I'm looking for another metric: the unique number of users who reacted to the article. I want to estimate the popularity of a given article, and total reactions can be tricky because one user can react multiple times.

Top comments (3)

Collapse
 
coffeecraftcode profile image
Christina Gorton

I have an answer for the first part of your question here:
positive_reactions_count is an alias for article.public_reactions_count. So they’re actually the same thing.
You can see the PR where this was changed and why it was aliased instead of removed completey.

Rename positive_reactions_count to public_reactions_count in logic #7926

What type of PR is this? (check all applicable)

  • [x] Refactor

Description

This moves the functionality from positive_reactions_count to public_reactions_count. All changes are simply renaming positive to public.

Related Tickets & Documents

#7919 #7932

Added tests?

  • [x] no, because they aren't needed

Added to documentation?

  • [x] no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

Spongebob and Patrick are thinking very, very hard.

" I'm looking for another metric: the unique number of users who reacted to the article."

I am talking to our product team about this part of your question and will let you know when I hear back from them πŸ˜ƒ

Collapse
 
idoshamun profile image
Ido Shamun

That's great I thought it's just an alias but it's good to have it checked :)
Waiting for your answer. Thanks a lot πŸ™

Collapse
 
coffeecraftcode profile image
Christina Gorton

Hey @idoshamun thanks for the question! I am asking internally for a more information on these fields and will try to get a more specific answer back to you soon.