QB64 Phoenix Edition
Phoenix Edition Repo Info - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Prolific Programmers (https://qb64phoenix.com/forum/forumdisplay.php?fid=26)
+---- Forum: SMcNeill (https://qb64phoenix.com/forum/forumdisplay.php?fid=29)
+---- Thread: Phoenix Edition Repo Info (/showthread.php?tid=388)



Phoenix Edition Repo Info - SMcNeill - 05-11-2022

(Say that title ten times fast!  That's a great tongue twister!)

Code: (Select All)
Screen _NewImage(1024, 720, 32)
com$ = "curl -H " + Chr$(34) + "Accept: application/vnd.github.v3+json" + Chr$(34)
com$ = com$ + " https://api.github.com/repos/QB64-Phoenix-Edition/QB64pe/releases"
com$ = com$ + " >temp.txt"

Shell _Hide com$
_Delay 1 'give the os time to download and create the file
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 Print Mid$(temp$, 33)
Loop

For anyone who wants to take a look at the number of downloads the Phoenix Edition has for each release, you can use the little app above to do so.

If you're really curious about a lot more junk than just the download count, you can open the "temp.txt" and get a whole status report on the repo and the releases and such.  I'm not certain if anyone else would be interested in this type of thing, but I thought I'd share just in case.  Wink


RE: Phoenix Edition Repo Info - bplus - 08-07-2022

(05-11-2022, 01:59 AM)SMcNeill Wrote: (Say that title ten times fast!  That's a great tongue twister!)

Code: (Select All)
Screen _NewImage(1024, 720, 32)
com$ = "curl -H " + Chr$(34) + "Accept: application/vnd.github.v3+json" + Chr$(34)
com$ = com$ + " https://api.github.com/repos/QB64-Phoenix-Edition/QB64pe/releases"
com$ = com$ + " >temp.txt"

Shell _Hide com$
_Delay 1 'give the os time to download and create the file
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 Print Mid$(temp$, 33)
Loop

For anyone who wants to take a look at the number of downloads the Phoenix Edition has for each release, you can use the little app above to do so.

If you're really curious about a lot more junk than just the download count, you can open the "temp.txt" and get a whole status report on the repo and the releases and such.  I'm not certain if anyone else would be interested in this type of thing, but I thought I'd share just in case.  Wink

Does not work for me, get error something like input past file.


RE: Phoenix Edition Repo Info - SMcNeill - 08-07-2022

@bplus Make it $Console:Only and then remove the _Hide from that Shell statement. It'll display the issue for you. When I tried earlier, I had to run the program 2 or 3 times, as it kept saying "github servers are busy" or some such nonsense.


RE: Phoenix Edition Repo Info - bplus - 08-07-2022

OK thanks!

I also increased the delay. Data Success!
   


RE: Phoenix Edition Repo Info - SMcNeill - 10-09-2023

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-Phoenix-Edition/QB64pe/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. Wink


RE: Phoenix Edition Repo Info - mnrvovrfc - 10-09-2023

If the above program is to be tried on Linux, it might be better to make a comment out of the line with `WIDTH`. Then go to the configuration of the terminal emulator of your choice and change the setting for scrollback. In this way, the size of the whole terminal could be decided. But horizontal scrolling sucks a lot for me, I expect word-wrapping or something else a bit more primitive.

Hmmm why pack on the earliest releases of QB64PE? We're going to have somebody ask, "Where was version 1 and version 2 of Phoenix Edition?" (scratch head)

This is a good technique that might work elsewhere in Github but I'm not going to press myself for it. I hate that site.