I'm trying to implement the standard like function to a custom view I wrote.
My code for getting the items, getting LikesCount and how I display them:
<script type="text/javascript">
$(document).ready(function() {
// Rest Call
var requestUri = "/_api/lists/getbytitle('Shout')/items";
var llength = "";
$.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
success: function (data) {
$.each(data.d.results, function (i, item){
var title = item.Title;
var description = item.Description;
var pictureURLDesc = item.PictureURL.Description;
var pictureURL = item.PictureURL.Url;
var linkDesc = item.Link.Description;
var linkURL = item.Link.Url;
var likesCount = item.LikesCount;
try
{
llength = description.slice(0, 120);
}
catch ( err )
{
alert( err );
}
// alert("The item has " + likesCount + " likes");
// Set News item
document.getElementById("head" + i).innerHTML = "<div class='thumbnail-img'><div class='overflow-hidden'><img class='img-responsive' src=" + pictureURL + " alt=" + pictureURLDesc + "/>  </div><a class='btn-more hover-effect' href='#'><i class='icon-thumbs-up'></i> " + likesCount + "</a></div><div class='caption'><h3><a class='hover-effect' href='#'>" + title + "</a></h3><p>" + llength + "</p></div>";
})
},
error: function () {
alert("Error getting items");
}
});
});
The function is turned on in the list and I can rate / unrate the items there.
This is how it is displayed by now:
Now I want this functionality in my script. I found several posts how to like a page, but nothing which helps me to like a list item.
I would like to call the function in here:
<a class='btn-more hover-effect' href='#'>
I can get the current LikesCount with REST, but how to set and unset?
Any Step-by-Step guides known?

