Jump to content

WGET, CURL & GUI bonus examples (udf)


Dreamfire
 Share

Recommended Posts

Hi all,

Because i wanted to download and read remote files through proxy servers and if needed use advanced authentication methods (e.g. NTLM), i made some useful functions that utilize standalone wget or curl executables (included).

http://publictoolsrepo.sourceforge.net/apps/wget-curl.zip - i was unable to attach it

#include <Array.au3>
#include 'udf_wget_curl.au3'

; gui examples
; ===============================================================================================================================

; a simple input window
Dim $sVALUE = __gui_create_input_dialog('this is the title of the window', 'this is the text shown on the window', 'name', '', False, -1, -1, False, FileRead('randomtext.txt'), 'a optional default value')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sVALUE = ' & $sVALUE & @CRLF) ;### Debug Console

; a simple input window with the screen dimmed and the field is passworded
Dim $sVALUE = __gui_create_input_dialog('another nice popup', 'this one shows the screen dimmed and the size of the window is relative to the text length' & @CRLF & 'this one shows the screen dimmed and the size of the window is relative to the text length', 'password? :)', '', True, -1, -1, True)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sVALUE = ' & $sVALUE & @CRLF) ;### Debug Console

; a simple combo window
Dim $sVALUE = __gui_create_combo_dialog('the title', 'the text', 'choose your food', '', False, -1, -1, False, '', 'Pizza|Burger|Raw Code',  '')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sVALUE = ' & $sVALUE & @CRLF) ;### Debug Console

; a auth window :)
Dim $aRESULT = __gui_create_auth_dialog('this looks legit', 'your data is safe with me ;)', 0, True, False, False)
_ArrayDisplay($aRESULT)

; a progress window example
Dim $aPROGRESS = __gui_progress_create('text displayed', 10, -1, 10, 'this footnote text is optional!')
Sleep(1000)
__gui_progress_set_bar_amount($aPROGRESS, 20, 'test updated :)')
Sleep(1000)
__gui_progress_set_bar_amount($aPROGRESS, 40, 'test updated :) and another')
Sleep(1000)
__gui_progress_set_bar_amount($aPROGRESS, 60, 'test updated :) and another and another')
Sleep(1000)
__gui_progress_set_bar_amount($aPROGRESS, 80, 'test updated :) and another and another and another')
Sleep(1000)
__gui_progress_destroy($aPROGRESS)

; wget-curl examples
; ===============================================================================================================================

; download a file with progess
__wget_download_start('http://ipv4.download.thinkbroadband.com/10MB.zip', @ScriptDir, 'randomtext.txt', 'a file for you')

; read a remote file :)
Dim $sFILE = __wget_read_remote_file('http://publictoolsrepo.sourceforge.net/apps/randomtext.txt')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sFILE = ' & $sFILE & @CRLF) ;### Debug Console

As a bonus i also included some of my GUI functions that are used by it.

image.png

image.png

image.png

Most functions are written and designed using a modular approach so they should be easily implementable.

 

The following dependencies are also included and i would like to credit the authors.

GIFAnimation - trancexx
ResourcesEx - Zedna (original) guinness (current)
_StringSize - Melba23

Edited by Dreamfire
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...