Const REL
= "210709.0519" Const DATABASE
= "app.db" Const DOWNLOAD_FOLDER
= "dl\" Const APP_NAME
= "AppGet Manager"
'create a download dir if not exists
' act on param sent
appGetHeader
'*** D O W N L O A D I N G F I L E
'*** Strip the filename off the end
'*** "file" is appended at the back of mediafire files.
thisAppLink
= Mid$(thisAppLink
, 1, Len(thisAppLink
) - 5)
LWRITELN "`2Downloading ... [ `0" + filename + " ]"
LWRITELN "`#URL: `%" + thisAppLink
'*** download it...
'Shell "cd " + DOWNLOAD_FOLDER + " && curl -LO -k " + thisAppLink + " && cd .."
'Shell "cd " + DOWNLOAD_FOLDER + " && Powershell -Command Invoke-WebRequest -Uri " + thisAppLink + " -Outfile " + filename + " && cd .."
LWRITELN "`6Downloading now, one moment . . ."
appTxt = FileDownload(thisAppLink, "dl/" + filename)
Print "Problem retreiving " + filename
+ " from " + thisAppLink
LWRITELN "`0Success! `6Your file has been saved to `%.\DL\ "
LWRITELN "`7If you do not see " + filename + "installing, check the taskbar below"
'check to see if it is an archive 7z,zip,rar,arj.exe
'*** originall was going to clean up, but save downloaded files
'Kill DOWNLOAD_FOLDER + filename
appGetHeader
LWRITELN "`!Usage: appget command [`%appname...]"
LWRITELN "`3Available commands:"
LWRITELN " `%d - `7download appname (or partial search)"
LWRITELN "`7Example:"
LWRITELN "`2appget `$d `0notepad`7"
' $include: 'utils.bi'
FileDownload
= URLDownloadToFileA
(0, URL
+ Chr$(0), File
+ Chr$(0), 0, 0)
'*** see page for variable types
'*** in order to work must be defined as offset
'*** https://www.qb64.org/wiki/Variable_Types
'If _FileExists("app.db") Then Kill "app.db"
LWRITE "`8Reading remote database...."
'*** download it...
'check to see if there is an existing one
appTxt = FileDownload(REMOTE_DB, "app.db") ' download the db and save it to "APP.DB"
Print "AppTxt Val = "; appTxt
LWRITELN "`4*** `2ISSUE RET RIEVING DATABASE `4***`7"
LWRITELN "`8Location: " + REMOTE_DB + "`7"
'Shell _Hide "rename app.txt app.db"
LWRITELN "`%Done!"
downloadDB
'If Not _FileExists(DATABASE) Then findApp = "": Exit Function
recNum = 1
appGetHeader
openDB
recCount = recCount + 1
'Remove the trailing "," if there is one.
'Sometimes I use a spread sheet to organize and when exporting it
'adds aother ","
EXPLODE aline, ",", d()
LWRITE "`8[`%"
LWRITE "`8] `3"
LWRITE " `8ver. `7"
matches(recNum) = d(2)
recNum = recNum + 1
Kill "app.db" ' Make sure each db is downloaded fresh
Print "Scanned "; recCount;
" files..." Print appname;
" not found. Put in a request"
LWRITELN
"`8[ `@0 `8] `4Cancel":
Print Line Input "Select id of app to install: "; appSelectStr: recNum
= Val(appSelectStr
) findApp$ = matches(recNum)
LWRITELN "`3- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
LWRITELN "`!" + APP_NAME + " x64 (Windows)`3 rel: `#" + REL
LWRITELN "`3- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "