Display Top 5 kudos board in new component

Hi All,

Anyone know how to write code to Display latest Top 5 kudos board in new component ?can refer to my attachment, i am new to lithium api


20170908155052778.png
Message 1 of 6
5 REPLIES
Community Management
APIs

Re: Display Top 5 kudos board in new component

@stanley - Do you mean you would like to see the latest Top 5 kudo-ed authors or Top 5 kudo-ed posts?

Message 2 of 6
Community Management
Social Media

Re: Display Top 5 kudos board in new component

@stanley : Kindly refer this Document . Hope it will work.

 

If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

Thanks & Regards,
Abhishek Illindra

Message 3 of 6

Re: Display Top 5 kudos board in new component

Hi @srujanayeruvaka, i mean top 5 kudo-ed posts for last month till now
Message 4 of 6

Re: Display Top 5 kudos board in new component

Hi @AbhishekIlindra , this one

SELECT id, subject, view_href FROM messages WHERE kudos.sum(weight) > 0 ORDER BY kudos.sum(weight) DESC LIMIT 5

 quite close to the data i want to retrieve , how to i limit to retrieve the most recent 1 month messages ?

Message 5 of 6
Highlighted
Solution

Re: Display Top 5 kudos board in new component

@stanley-

 

This might be helpful https://community.lithium.com/t5/Developer-Discussion/posts-count-of-last-7-days/m-p/315841#M12205.

 

<#assign today = .now?long />

<#assign minus30days= today - (30 * 24 * 60 * 60 * 1000) />

<#assign since30days= minus30days?number_to_datetime?iso('GMT-08:00') />

SELECT id, subject, view_href FROM messages WHERE kudos.sum(weight) > 0 and post_time > ${since30days} ORDER BY kudos.sum(weight) DESC LIMIT 5

 

 

Give kudos if you find my posts helpful or mark solution if it answers your query.
Tariq
Message 6 of 6