cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-320888%22%20slang%3D%22en-US%22%3EDisplay%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320888%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3EAnyone%20know%20how%20to%20write%20code%20to%20Display%20latest%20Top%205%20kudos%20board%20in%20new%20component%20%3Fcan%20refer%20to%20my%20attachment%2C%20i%20am%20new%20to%20lithium%20api%3C%2FP%3E%3CBR%20%2F%3E%3CIMG%20src%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F47287iB8DCE1BD48DFB1FE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20border%3D%220%22%20alt%3D%2220170908155052778.png%22%20title%3D%2220170908155052778.png%22%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320912%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320912%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62463%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40stanley%3C%2FA%3E-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20might%20be%20helpful%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2FDeveloper-Discussion%2Fposts-count-of-last-7-days%2Fm-p%2F315841%23M12205%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcommunity.lithium.com%2Ft5%2FDeveloper-Discussion%2Fposts-count-of-last-7-days%2Fm-p%2F315841%23M12205%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%26lt%3B%23assign%20today%20%3D%20.now%3Flong%20%2F%26gt%3B%0A%0A%26lt%3B%23assign%20minus30days%3D%20today%20-%20(30%20*%2024%20*%2060%20*%2060%20*%201000)%20%2F%26gt%3B%0A%0A%26lt%3B%23assign%20since30days%3D%20minus30days%3Fnumber_to_datetime%3Fiso('GMT-08%3A00')%20%2F%26gt%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FPRE%3E%3CPRE%3ESELECT%20id%2C%20subject%2C%20view_href%20FROM%20messages%20WHERE%20kudos.sum(weight)%20%26gt%3B%200%20and%20post_time%20%26gt%3B%20%24%7Bsince30days%7D%20ORDER%20BY%20kudos.sum(weight)%20DESC%20LIMIT%205%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320910%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320910%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F34693%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40AbhishekIlindra%3C%2FA%3E%20%2C%20this%20one%3C%2FP%3E%3CPRE%3ESELECT%20id%2C%20subject%2C%20view_href%20FROM%20messages%20WHERE%20kudos.sum(weight)%20%26gt%3B%200%20ORDER%20BY%20kudos.sum(weight)%20DESC%20LIMIT%205%3C%2FPRE%3E%3CP%3E%26nbsp%3Bquite%20close%20to%20the%20data%20i%20want%20to%20retrieve%20%2C%20how%20to%20i%20limit%20to%20retrieve%20the%20most%20recent%201%20month%20messages%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320901%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320901%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62463%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40stanley%3C%2FA%3E%26nbsp%3B%20You%20can%20use%20below%20API%3C%2FP%3E%3CPRE%3E%26lt%3B%23assign%20topKudoedAuthor%3Drest(%22%2Fkudos%2Fauthors%2Fleaderboard%3Fmax_age%3Done_month%26amp%3Bpage_size%3D5%22).users.user%20%20%2F%26gt%3B%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320898%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320898%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F63438%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40srujanayeruvaka%3C%2FA%3E%2C%20i%20mean%20top%205%20kudo-ed%20posts%20for%20last%20month%20till%20now%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320896%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320896%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62463%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40stanley%3C%2FA%3E%26nbsp%3B%3A%20Kindly%20refer%20this%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2FDeveloper-Knowledge-Base%2FObtaining-Latest-Posts-Top-Kudoed-Posts-and-Top-Kudoed-Authors%2Fta-p%2F6835%23topKudoPostsNode%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EDocument%3C%2FA%3E%26nbsp%3B.%26nbsp%3BHope%20it%20will%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20my%20post%20is%20helpful%20and%20answers%20your%20question%2C%20please%20give%20%22Kudos%22%20and%20%22Accept%20it%20as%20a%20Solution.%22%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20%26amp%3B%20Regards%2C%3CBR%20%2F%3EAbhishek%20Illindra%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-320895%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Top%205%20kudos%20board%20in%20new%20component%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-320895%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62463%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40stanley%3C%2FA%3E%26nbsp%3B-%20Do%20you%20mean%20you%20would%20like%20to%20see%20the%20latest%20Top%205%20kudo-ed%20authors%20or%20Top%205%20kudo-ed%20posts%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Commentator

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
5 Replies 5
Highlighted
Honored Contributor

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

Highlighted

@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

Highlighted

Hi @srujanayeruvaka, i mean top 5 kudo-ed posts for last month till now
Highlighted

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 ?

Highlighted

@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