10-09-2023, 12:41 PM
Code: (Select All)
$CONSOLE:ONLY
WIDTH 120, 70, 120, 100
IF _FILEEXISTS("temp.txt") THEN KILL "temp.txt"
com$ = "curl -H " + CHR$(34) + "Accept: application/vnd.github.v3+json" + CHR$(34)
com$ = com$ + " https://api.github.com/repos/QB64-Phoeni...e/releases"
'com$ = com$ + " https://api.github.com/repos/QB64Official/qb64/releases"
com$ = com$ + " >temp.txt"
SHELL com$
PRINT "Downloading..";
DO
_LIMIT 30
PRINT ".";
LOOP UNTIL _FILEEXISTS("temp.txt")
PRINT
OPEN "temp.txt" FOR BINARY AS #1
DO UNTIL EOF(1)
LINE INPUT #1, temp$
IF INSTR(temp$, "download_count") THEN PRINT MID$(temp$, 27),
IF INSTR(temp$, "browser_download_url") THEN
temp1$ = MID$(temp$, 33)
'temp1$ = MID$(temp1$, _INSTRREV(temp1$, "/") + 1)
PRINT temp1$
END IF
LOOP
PRINT
PRINT "Press <ESC> to exit."
DO
_LIMIT 30
LOOP UNTIL INKEY$ = CHR$(27)
New version of this little tool available, with a little better logic checking so that the file downloads fully before we start trying to read it. I've ran it several times now for testing, and it hasn't glitched out once like the old version did from time to time.