as i've explained in another answer to one of your many posts (side
note: could you avoid asking the same question in more than one place?
:) ), the best way is to append the user-id you want to check to
'/tracks/{track-id}/favoriters', and inspect the response's status
code:
'/tracks/{track-id}/favoriters/{user-id}'
as documented here[1]
Lorenzo // API Team
[1]: https://github.com/soundcloud/api/wiki/10.2-Resources:-tracks-continued
On Fri, Feb 11, 2011 at 10:01 PM, candytunes.com
<trevor...@gmail.com> wrote:
> is there a more efficient way of testing for favorited?
> ( i am also doing the same for testing whether i am following a user)
>
> this as3 api call does not work:
>
> tracks/{track_id}/favoriters/{user_id}
>
> but this does:
> tracks/{track_id}/favoriters
>
> heres my solution to test for a track being favored by the logged in
> user:
>
> private function _checkUserFavorite():void
> {
> var delegate2:SoundcloudDelegate =
> SoundCloudConnect.scClient.sendRequest("tracks/"+this.model.activeSong.songID
> +"/favoriters", URLRequestMethod.GET);
> delegate2.addEventListener(SoundcloudEvent.REQUEST_COMPLETE,
> _setFavoriteFlag);
> }
>
> private function _setFavoriteFlag(e:SoundcloudEvent):void
> {
> var data:Object = e.data;
> for (var i:* in data) {
> if(data[i].id==this.model.userID)
> {
> trace(i + ": "+data[i].id + "::" + this.model.userID);
> this._favorite = "true";
> }
> }
> this._picHolder.removeEventListener(MouseEvent.CLICK,
> this._infoURL);
> if(this._favorite == "true")this.showFav();
> else this.hideFav();
> }
>
> this works but it's a little slow when a track has a lot of favoriters
>
> it's especially cumbersome for checking followngs because it loads all
> user data for every follower
>
> --
> You received this message because you are subscribed to the Google Groups "SoundCloudAPI" group.
> To post to this group, send email to soundc...@googlegroups.com.
> To unsubscribe from this group, send email to soundcloudap...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/soundcloudapi?hl=en.
>
>
No probs, just try to use the existing threads when they are still relevant :)
And your questions are very appreciated, after all that's why we're
here ain't we?
Greets,
Lorenzo // API Team
On Mon, Feb 14, 2011 at 5:11 PM, candytunes.com <trevor...@gmail.com> wrote:
> I get the picture. please remove this thread.
>