Soundcloud API

  • VB.NET

Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von rotherford.

    Soundcloud API

    Hey vbp!
    Ich setze mich grade mit der SoundCloud api auseinander....
    Das login klappt schonmal!
    Nun möchte ich einen follower adden...
    Nur bekomme ich einen 404 Error!

    VB.NET-Quellcode

    1. SoundCloud = New HttpUtility
    2. SoundCloud.Start()
    3. Dim Source As String = ""
    4. Dim Username As String = SoundCloud.URLEncode("user")
    5. Dim Password As String = SoundCloud.URLEncode("password")
    6. Dim ClientID As String = "clientID"
    7. Dim ClientSecret = "clientsecret"
    8. Source = SoundCloud.CreateRequest("https://api.soundcloud.com/oauth2/token", "client_id=" & ClientID & "&client_secret=" & ClientSecret & "&grant_type=password&username=" & Username & "&password=" & Password, "http://www.soundcloud.com")
    9. Dim _Token As String = ""
    10. Dim regx As String = ".*?" & """.*?""" & ".*?" & "("".*?"")"
    11. Dim r As Regex = New Regex(regx, RegexOptions.IgnoreCase Or RegexOptions.Singleline)
    12. Dim m As Match = r.Match(Source)
    13. If (m.Success) Then
    14. _Token = m.Groups(1).Value.Replace(Chr(34), "")
    15. MsgBox("Login erfolgreich!")
    16. Else
    17. MsgBox("Login fehlgeschlagen!")
    18. End If
    19. Source = SoundCloud.CreateRequest("https://api.soundcloud.com/me/followings/3207" , "client_id=" & ClientID & "&oauth_token=" & _Token) ' VERSUCH jemaden als follower zu adden = 404