Hello,
I'm searching in the API what could be the best option for find the most popular threads of a forum but I can't find it.
Could you help me?
Thanks,
Laurent
Solved! Go to Solution.
Here is the API to fetch the popular messages based on
a) most views
Select * from messages order by metrics.views desc
b) most kudoed
Select * from messages order by kudos.sum(weight) desc
Thanks.
But it's about the "messages".
I found on the API V1 something with the thread but looks like it's not for the standard forums ("Used with Contest and Idea Exchange boards")
Laurent
It is also for the forums. Here board means a forum.
http://community.lithium.com/community-name/restapi/vc/boards/id/[id] /threads/popular
Or you can use this API as well
select * from messages order by popularity desc
This call also works on nodes that are not contest or idea exchange nodes, e.g. https://lithosphere.lithium.com/lithosphere/restapi/vc/boards/id/technology/threads/popular
Just a clarification for the example by @VikasB for a API v2 LiQL query:
Even if you restrict it to only the top level message of a thread by adding "WHERE depth = 0" to form the complete
SELECT * FROM messages WHERE depth = 0 ORDER BY popularity DESC
...you would get the most popular message starting a topic. It wouldn't be the most popular thread as a metrics over kudos given across all message within a thread. Currently I can't think of a way to achieve this using Community API v2.
Welcome to the Technology board!
Curious about our platform? Looking to connect on social technology? You've come to the right place!