_GetTrack UDF

  • Hi,
    Ich möchte euch meine UDF vorstellen um den aktuell laufenden Track von "TechnoBase.FM" zurückzugeben

    Funktion:

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ===================================================================
    ; Name ..........: _GetTrack
    ; Description ...: Returns the Current running Track from the Internetradio
    ; "TechnoBase.FM".
    ; AutoIt Version : V3.3.2.0
    ; Syntax ........: _GetTrack()
    ; Parameter(s): .:
    ; Return Value ..: Success - Track
    ; Failure - Error
    ; @ERROR - 1 TechnoBase is Offline
    ; - 2 No Connection to the Internet
    ; - 3 TechnoBase internal Error
    ; Author(s) .....: ettecks
    ; Date ..........: 1st February 2010
    ; Link ..........: https://autoit.de/index.php?page=User&userID=203936
    ; Related .......:
    ; Example .......: No
    ; ==============================================================================
    Func _GetTrack()
    Local $Right = "20"
    Local $Left = "20"
    Ping("http://www.technobase.fm/tracklist.php") ; Check If TechnoBase is Online
    If @error Then
    SetError(1)
    EndIf
    Ping("www.google.de") ; Check If Internetconnection exists
    If @error Then
    SetError(2)
    Else
    $Source = _INetGetSource("http://www.technobase.fm/tracklist.php") ; Get Source
    $Between = _StringBetween($Source, 'hidden">', '') ; Find Track
    $A1 = StringTrimLeft($Between[0], $Left) ; Remove Spaces on the left
    If @error Then ; If Track coudln't be found then
    SetError(3) ; SetError
    Else
    $A2 = StringTrimRight($A1, $Right) ; Remove Spaces on the right
    Return $A2 ; Return the Raw Track
    EndIf
    EndIf
    EndFunc ;==>_GetTrack

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


    Wenn ihr Fehler findet macht mich bitte darauf aufmerksam.
    Beispiel:

    Spoiler anzeigen
    [autoit]

    #include <_GetTrackUDF.au3>
    Example()

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

    Func Example()
    $Track = _GetTrack()
    MsgBox(0,"TechnoBase.FM Track", "Auf Technobase läuft gerade: " & @CRLF & $Track)
    EndFunc

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


    Hoffe sie ist irgendwem nützlich.
    Freue mich auf Feedback.
    MfG,
    ettecks