Shoutcast

  • Hallo Leute ^^
    Ich habe hier ein Script dass den Streamtitle ausliest.

    [autoit]

    Func _Shoutcast_GetListener($IP, $Port, $RecvLength = 10240)
    Local $Connection = TCPConnect(TCPNameToIP($IP), $Port)
    Local $Recv = ""
    Local $Paket = "GET /7.html HTTP/1.1" & @CRLF & _
    "Host: streamurl:8000" & @CRLF & _
    "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" & @CRLF & _
    "Connection: close" & @CRLF & @CRLF
    TCPSend($Connection, $Paket)

    [/autoit][autoit][/autoit][autoit]

    Do
    $Recv = TCPRecv($Connection, $RecvLength)
    Until $Recv <> ""

    [/autoit][autoit][/autoit][autoit]

    TCPCloseSocket($Recv)

    [/autoit][autoit][/autoit][autoit]

    $Recv = StringRegExp($Recv, "<body>(.*?)</body>", 1)
    $Recv = $Recv[0]

    [/autoit][autoit][/autoit][autoit]

    $Recv = StringSplit($Recv, ",")
    Return $Recv[$Recv[0]]
    EndFunc ;==>_Shoutcast_GetListener

    [/autoit]


    Jetzt möchte ich dass er aber auch die Listener anzeigt,ich bekomme es aber nicht hin.
    Könnt Ihr mir da bitte helfen?
    mfg. nils

  • Quellcode:

    Code
    <HTML><meta http-equiv="Pragma" content="no-cache"></head><body>131,1,151,800,127,128,Gith & Ma.Bra. - Choose Your Destiny (Raindropz! Remix)</body></html>
  • Spoiler anzeigen
    [autoit]

    #region - Timestamp
    ;2011-05-22 22:58:49
    #endregion - Timestamp

    [/autoit] [autoit][/autoit] [autoit]

    $sSource = '<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>131,1,151,800,127,128,Gith & Ma.Bra. - Choose Your Destiny (Raindropz! Remix)</body></html>'

    [/autoit] [autoit][/autoit] [autoit]

    $aTmp = StringRegExp($sSource, '<body>(.*?)</body>', 1, 1)

    [/autoit] [autoit][/autoit] [autoit]

    If IsArray($aTmp) Then
    $aBody = StringSplit($aTmp[0], ",", 3)
    If IsArray($aBody) Then
    If $aBody[1] = 1 Then
    ConsoleWrite("Listener: " & $aBody[0] & @CRLF & "Status: " & $aBody[1] & @CRLF & "Peak: " & $aBody[2] & @CRLF & "Max. Listeners: " & $aBody[3] & @CRLF & "Reproted: " & $aBody[4] & @CRLF & "Bits: " & $aBody[5] & @CRLF & "Song: " & $aBody[6] & @CRLF)
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit]