Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Get Like Count for Post #48

Open
codingshot opened this issue Sep 8, 2024 · 0 comments
Open

[Feature]: Get Like Count for Post #48

codingshot opened this issue Sep 8, 2024 · 0 comments
Labels
✨ feature New feature or request

Comments

@codingshot
Copy link

What is your idea or feature suggestion?

Easily index post with like count and easy to query who liked

Benefits

Better for engagement with posts
if i am on liked list, easier interaction for liking and unliking
can easily index posts to prioritize feeds with most likes

Where can we find information about this?

social .near contract
example post

const likes = Social.index("like", item);

const dataLoading = likes === null;

const likesByUsers = {};

(likes || []).forEach((like) => {
if (like.value.type === "like") {
likesByUsers[like.accountId] = like;
} else if (like.value.type === "unlike") {
delete likesByUsers[like.accountId];
}
});

https://near.social/mob.near/widget/WidgetSource?src=mob.near/widget/N.LikeButton
{
"plugrel.near": {
"index": {
"like": "{"key":{"type":"social","path":"mob.near/post/main","blockHeight":113725812},"value":{"type":"like"}}",
"notify": "{"key":"mob.near","value":{"type":"like","item":{"type":"social","path":"mob.near/post/main","blockHeight":113725812}}}"
}
}
}

also how to like https://near.social/mob.near/widget/WidgetSource?src=mob.near/widget/N.LikeButton

Are you willing to provide a PR to address this?

None

@codingshot codingshot added the ✨ feature New feature or request label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant