#Include #include #Include #include #include #include #include #include #include #include Local $oIE = _IECreateEmbedded() #Region ### START Koda GUI section ### Form=C:\Users\Hunter\Desktop\Programming\Projects\AutoIt\TV Shows.kxf $Form1 = GUICreate("TV Shows", 590, 452, -1, -1) $List1 = GUICtrlCreateList("", 8, 40, 233, 383, BitOR($WS_BORDER, $WS_VSCROLL)) $Button1 = GUICtrlCreateButton("Visit Webpage", 486, 424, 99, 25) $List2 = GUICtrlCreateList("", 247, 40, 337, 383, BitOR($WS_BORDER, $WS_VSCROLL)) $Label1 = GUICtrlCreateLabel("TV Shows", 8, 21, 53, 17) $Label2 = GUICtrlCreateLabel("Episodes", 248, 21, 47, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $currenttitle Global $titles Global $cleantitle Global $array3 Global $array2 Global $array1 Global $array4 Global $array5 Global $array6 Global $selectedtitlenum Global $selectedtitlesite Global $selectioncheck="0" Global $selectioncheck2="0" Global $currentep Global $eps Global $eps2 Global $epssplit Global $selectedepssite Global $array7 Global $watchitheresite Global $watchhere Global $finalsite Global $allinfo Retrieve() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 RetrieveSelectedEpisode() EndSwitch ReadSelectedTitle() WEnd Func Retrieve() $Url = "http://www.couchtuner.ch/" ; Tv List Source $array1 = _StringBetween(_INetGetSource ($Url), "

Ongoing Tv List ONLY!

", "") $info = $array1[0] ; Seperate tv shows source to a array $array2 = _StringBetween($info, "
  • ", "") ; Create a array of tv shows links (1st set of links) $array3 = _StringBetween($info, '", "") ; Convert the current title to a string $cleantitle=BinaryToString($currenttitle[0], 4) $cleantitle=StringReplace($cleantitle, '& ', '') ; Create a array of titles $titles=""&$titles&"|"&$cleantitle&"" Next ; Set List1 to the title names GUICtrlSetData($List1, $titles) EndFunc Func ReadSelectedTitle() $selection = GUICtrlRead($list1) if $selectioncheck <> $selection Then if $selection <> "" Then $selectioncheck = $selection $titlessplit = StringSplit($titles, "|") For $i = 0 to UBound($titlessplit) - 1 if $titlessplit[$i] = $selection Then $selectedtitlenum = $i - 1 EndIf Next $selectedtitlesite=$array3[$selectedtitlenum] Retrieve2() EndIf EndIf EndFunc Func Retrieve2() ;Episodes Source $array4 = _StringBetween(_INetGetSource ($selectedtitlesite), '
  • ', '



    ') $info2 = $array4[0] ; Seperate tv shows source to a array $array5 = _StringBetween($info2, '
    ") ; Create a array of tv shows links (2nd set of links) $array6 = _StringBetween($info2, 'ef="', '"') For $i = 0 to UBound($array5) - 1 ; Extract title from seperated tv shows source $currentep=_StringBetween($array5[$i], ">", "") ; Create a array of titles $eps=""&$eps&"|"&$currentep[0]&"" Next ; Set List1 to the title names GUICtrlSetData($List2, "") GUICtrlSetData($List2, $eps) $eps2 = $eps $eps = "" EndFunc Func RetrieveSelectedEpisode() $selection = GUICtrlRead($List2) if $selection <> "" Then $epssplit = StringSplit($eps2, "|") For $i = 0 to UBound($epssplit) - 1 if $epssplit[$i] = $selection Then $selectedepsnum = $i - 2 EndIf Next $selectedepssite=$array6[$selectedepsnum] Visit() EndIf EndFunc Func Visit() Run(@ComSpec & " /c start " & $selectedepssite, "", @SW_HIDE) EndFunc