Check if one user is following another, using the SC (sound cloud) API in Javascript

Asked

Viewed 57 times

2

I am developing a web page, where this page will be using the SC SDK API. What happens is, I’m not being able to use the function that checks if one user follows the other. In this case, the user would log in to the page and a function would check if this user who is logged in, if it is following the owner of the page...

In this case I did it in a way, but it is limited by SC.

$("#connect").live("click", function(){
var follo = 400;
SC.get("/users/"+ idUser +"/followings",{
            limit: follo
        },function (followings) {

        for (var i = 0; i < followings.length; i++){
             var id = followings[i].id;
             if(id == idUser){
               alert('True');
               break;
        };
  };
});

This way it even works as I want, I take the list of all the people that the user follows and check if the owner of the page is in this list, however... if I do not set a limit, the default limit is 50 user, and if I set a limit, I can expand up to the MAXIMUM 200 user, even if the limit is 400 as in the example above, but there are users who follow much more users. In the link I passed up, there is an example that I think would solve my case, but I did not find a right way to use:

/users/{id}/followings/{id} a user who is followed by the user.
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.