#include #include #include #include #include #include #include #include #Region ### START Koda GUI section ### Form=K:\github download_count.kxf $Form2 = GUICreate("Form2", 748, 379, 303, 268) $ListView1 = GUICtrlCreateListView("version|nom|téléchargement", 16, 64, 714, 302, BitOR($GUI_SS_DEFAULT_LISTVIEW,$WS_VSCROLL,$WS_BORDER)) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 500) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 109) $input = GUICtrlCreateInput("https://github.com/serpafi/TAO-MKV/releases", 16, 8, 713, 21) $Button1 = GUICtrlCreateButton("Valider", 656, 32, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $1, $2, $3, $count = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $sString = StringReplace(GUICtrlRead($input),'/github','/api.github') $sString = StringReplace($sString,'.com/','.com/repos/') dim $Aarray[0][3] _GUICtrlListView_DeleteAllItems ( $ListView1 ) Local $line = StringSplit (BinaryToString(InetRead ($sString)), ',') For $i = 0 to UBound($line) -1 If StringInStr($line[$i],'"tag_name":') <> 0 Then $1 = StringReplace ( StringTrimLeft ($line[$i],StringInStr($line[$i],':"')+1),'"','') $1 = StringReplace($1, " ","") $count = 1 Endif If StringInStr($line[$i],'"name":') <> 0 Then $2 = StringReplace ( StringTrimLeft ($line[$i],StringInStr($line[$i],':"')+1),'"','') $count = 2 Endif If StringInStr($line[$i],'download_count":') <> 0 Then $3 = StringReplace ( StringTrimLeft ($line[$i],StringInStr($line[$i],'":')+1),'"','') $count = 3 Endif If $count = 3 Then ConsoleWrite("######## numero final = " & $1&" "&$2&" "&$3&@CRLF) _ArrayAdd ( $Aarray, $1&"|"&$2&"|"&$3,0,"|") $count = 0 EndIf Next For $i = 0 to UBound($Aarray) -1 _GUICtrlListView_AddItem ( $ListView1, $Aarray[$i][0]) _GUICtrlListView_AddSubItem ( $ListView1, $i, $Aarray[$i][1], 1 ) _GUICtrlListView_AddSubItem ( $ListView1, $i, $Aarray[$i][2], 2 ) Next EndSwitch WEnd