kipwoker / SoundCloud.API.Client

It's .NET client for SoundCloud API https://developers.soundcloud.com/docs/api/reference
52 stars 14 forks source link

Add support for the API-V2 endpoint #2

Closed opcon closed 8 years ago

opcon commented 8 years ago

Hi,

I added support for the API-V2 endpoint, specifically the Explore and Charts api. I also added null value handling to the JSON parser, and ignored new line characters in tag parsing, since it was broken for me.

Cheers, Patrick

opcon commented 8 years ago

I also forgot to say in the original pull request, I understand if you don't want to merge this, since the V2 API's are undocumented and unsupported by SoundCloud.

There's no guarantee that they are stable, and in fact the Explore endpoint disappeared today. The Charts one still exists though, and I've been using it extensively in my own programs.

kipwoker commented 8 years ago

@opcon I'm making review. I think i will finish it soon. :)

kipwoker commented 8 years ago

@opcon I've made review. Check out my commits. https://github.com/kipwoker/SoundCloud.API.Client/tree/opcon-master I want to merge it into master but exploreApi.GetExploreCategories always returns 404. Do you know why it so? Also i didn't find any documentation. So if you have something to read please give me a link. :)

opcon commented 8 years ago

Thanks for taking time to review it, the changes are good! :)

For documentation, unfortunately the V2 API is undocumented and unstable. All I have are the notes I made when I was implementing it, which you can read here. All the endpoints I found using Chrome's developer tools.

Unfortunately it appears that the explore endpoint no longer exists, and the categories are now hardcoded into the clientside javascript for the SoundCloud website.

These categories are still used for the Charts API.

For the app I'm using, I have a function to list all the categories, which I extracted from the SoundCloud website:

public static List<SCExploreCategory> GetSoundcloudCategories()
{
    return new List<SCExploreCategory>
    {
        new SCExploreCategory { Name = "Popular+Music" },
        new SCExploreCategory { Name = "Alternative+Rock" },
        new SCExploreCategory { Name = "Ambient" },
        new SCExploreCategory { Name = "Classical" },
        new SCExploreCategory { Name = "Country" },
        new SCExploreCategory { Name = "Dance+&+EDM" },
        new SCExploreCategory { Name = "Dancehall" },
        new SCExploreCategory { Name = "Deep+House" },
        new SCExploreCategory { Name = "Disco" },
        new SCExploreCategory { Name = "Drum+&+Bass" },
        new SCExploreCategory { Name = "Dubstep" },
        new SCExploreCategory { Name = "Electronic" },
        new SCExploreCategory { Name = "Folk+&+Singer-Songwriter" },
        new SCExploreCategory { Name = "Hip-Hop+&+Rap" },
        new SCExploreCategory { Name = "House" },
        new SCExploreCategory { Name = "Indie" },
        new SCExploreCategory { Name = "Jazz+&+Blues" },
        new SCExploreCategory { Name = "Latin" },
        new SCExploreCategory { Name = "Metal" },
        new SCExploreCategory { Name = "Piano" },
        new SCExploreCategory { Name = "Pop" },
        new SCExploreCategory { Name = "R&B+&+soul" },
        new SCExploreCategory { Name = "Reggae" },
        new SCExploreCategory { Name = "Reggaeton" },
        new SCExploreCategory { Name = "Rock" },
        new SCExploreCategory { Name = "Soundtrack" },
        new SCExploreCategory { Name = "Techno" },
        new SCExploreCategory { Name = "Trance" },
        new SCExploreCategory { Name = "Trap" },
        new SCExploreCategory { Name = "Triphop" },
        new SCExploreCategory { Name = "World" },
    };
}

One possibility is to implement this into the library somewhere.

kipwoker commented 8 years ago

@opcon Oh. I see. Thank you for link. I will explore it. ;) Also, I will implement your list in API as enum with extension possibility. But I'm busy this week and will do it at next