How To Find Users Who Like A Certain Comment In Livefyre
Solution 1:
OK, it looks like you need to use the Livefyre bootstrap API, specifically this section.
So in our case, we're using jQuery to do a $.getJSON
request to http://bootstrap.{network}/bs3/{network}/{site_id}/{b64url_articleId}/init
.
{network}
: Refers to the Livefyre network, something like company.co, if you're using your own custom version.{site_id}
: The six-digit entry for your Livefyre account, something like 333888.{b64url_articleId}
: If using a URL as an article ID, you could use JavaScript'swindow.btoa()
function to convert the string to a base64-encoded entity. If you need to support IE < 10, see this article and just take the encode part.
After you query this data, you'll get something like the test results from the Livefyre documentation. Each comment will be nested inside a childContent
array of objects. Likes should be type 1
events, from this documentation. Ones you have the likes, you can compare the authorId
to the hash of users in the headDocument.authors
object to get the usernames. Here's a good example of what this data looks like.
It's a little convoluted, but by doing the above, and recursively diving into any subcomments and such, you should be able to extract all the users who like a user-submitted comment. Hope it helps.
Post a Comment for "How To Find Users Who Like A Certain Comment In Livefyre"