Twitch Stream Online

  • VB.NET
  • .NET (FX) 4.0

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von newcat.

    Twitch Stream Online

    Guten Morgen zusammen...

    Ich möchte eine Stream abfrage erstellen für einen twitch kanal das Programm und Code gehen...

    nur hab ich kein plan wie ich das jetzt abrufe also Welcher link prüft ob der stream online ist is ja nicht so das ich einfach nen namen eingeben muss xDDD

    Das Programm:

    VB.NET-Quellcode

    1. Private Sub nWatch_Tick(sender As Object, e As EventArgs) Handles NWatch.Tick
    2. If (isOnline("")) Then
    3. 'Online
    4. NotifyIcon1.Icon = SystemIcons.Exclamation
    5. NotifyIcon1.BalloonTipTitle = ""
    6. NotifyIcon1.BalloonTipText = ""
    7. NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info
    8. NotifyIcon1.ShowBalloonTip(30000)
    9. Else
    10. 'Offline
    11. NotifyIcon1.Icon = SystemIcons.Exclamation
    12. NotifyIcon1.BalloonTipTitle = ""
    13. NotifyIcon1.BalloonTipText = ""
    14. NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info 'icon wieder umändern
    15. NotifyIcon1.ShowBalloonTip(30000)
    16. End If
    17. End Sub
    18. Private Function isOnline(ByVal username As String) As Boolean
    19. Dim a As New System.Net.WebClient
    20. Dim b As String = a.DownloadString("LINK" & username)
    21. Return b <> "[]"
    22. End Function


    Jemand ne idee?!

    Danke im vorraus

    github.com/swiftyspiffy/Twitch…er/TwitchLib/TwitchAPI.cs


    Sieh dir die Methode

    Quellcode

    1. BroadcasterOnline
    an...
    die URL zur Determinierung des Online-Status' eines Kanals ist:

    Quellcode

    1. $"https://api.twitch.tv/kraken/streams/{channel}"
    ($ bedeutet das {channel} ersetzt wird durch ein Parameter)

    Der Respond muss:

    Quellcode

    1. {\"stream\":{\"_id\":
    sein.

    Siehe: github.com/swiftyspiffy/TwitchLib und such gegebenenfalls nach "online".
    Und Gott alleine weiß alles am allerbesten und besser.