Top Contributor, Top Kudos, and Users Online API Code
- 10 years ago
JasonMi - Here you go:
- For the Users online, we have 2 OOTB components in studio, but both do not serve your purpose, one shows only names and other shows only avatars, so here is the sample code for a custom component for this widget, you can scale it accordingly.
<#assign usersOnline = rest("/users/online/registered?restapi.response_style=view").users> <#list usersOnline.user as user> <#assign userAvatar = rest("/users/id/${user.id}/profiles/avatar/url").value > <div class="online_users"> <img src="${userAvatar}"/> <a href="${user.@view_href}">${user.login}</a> </div> </#list>
this is working and I have tested this, you just need to apply styling etc. add other factors such as count etc. using REST calls below:
For count of online Users:
https://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=Community.users.online.count#Community.users.online.anonymous.count
Users Online, from here you can loop through the XML and display the results:
https://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=Community.users.online#Community.users.online.registered2. For the Top Kudoed, it seems to be the default component, attached is the screenshot with my comment in green box.
3. For the profile cards, you can check with Lithium Professional Services as I don't know where we can toggle it at a global level.
I hope this helps.