ronaksomani
10 years agoMentor
How to show highest Kudos posts using API2?
Hi,
I want to show most active posts based on either number of kudos or views. I found a way to implement based on number of replies. But could not find similar approach for kudos/views.
For replies : SELECT * FROM messages Where depth=0 ORDER BY replies.count(*) DESC
I need approach using API2 (LiQl). Can any one help?
ronaksomani - You can do it either way,
Based on the number of Kudos:
SELECT * FROM messages WHERE kudos.sum(weight)>0 AND depth = 0 ORDER BY kudos.sum(weight) DESC Based on the number of views:
SELECT * FROM messages WHERE depth = 0 ORDER BY metrics.views DESC