"Little Monster's" front end to wget.
Example A-30. Making wget easier to use
1 #!/bin/bash
2 # wgetter2.bash
3
4 # Author: Little Monster [
[email protected]]
5 # ==> Used in ABS Guide with permission of script author.
6 # ==> This script still needs debugging and fixups (exercise for reader).
7 # ==> It could also use some additional editing in the comments.
8
9
10 # This is wgetter2 --
11 #+ a Bash script to make wget a bit more friendly, and save typing.
12
13 # Carefully crafted by Little Monster.
14 # More or less complete on 02/02/2005.
15 # If you think this script can be improved,
16 #+ email me at:
[email protected]
17 # ==> and cc: to the author of the ABS Guide, please.
18 # This script is licenced under the GPL.
19 # You are free to copy, alter and re-use it,
20 #+ but please don't try to claim you wrote it.
21 # Log your changes here instead.
22
23 # =======================================================================
24 # changelog:
25
26 # 07/02/2005. Fixups by Little Monster.
27 # 02/02/2005. Minor additions by Little Monster.
28 # (See after # +++++++++++ )
29 # 29/01/2005. Minor stylistic edits and cleanups by author of ABS Guide.
30 # Added exit error codes.
31 # 22/11/2004. Finished initial version of second version of wgetter:
32 # wgetter2 is born.
33 # 01/12/2004. Changed 'runn' function so it can be run 2 ways --
34 # either ask for a file name or have one input on the CL.
35 # 01/12/2004. Made sensible handling of no URL's given.
36 # 01/12/2004. Made loop of main options, so you don't
37 # have to keep calling wgetter 2 all the time.
38 # Runs as a session instead.
39 # 01/12/2004. Added looping to 'runn' function.
40 # Simplified and improved.
41 # 01/12/2004. Added state to recursion setting.
42 # Enables re-use of previous value.
43 # 05/12/2004. Modified the file detection routine in the 'runn' function
44 # so it's not fooled by empty values, and is cleaner.
45 # 01/02/2004. Added cookie finding routine from later version (which
46 # isn't ready yet), so as not to have hard-coded paths.
47 # =======================================================================
48
49 # Error codes for abnormal exit.
50 E_USAGE=67 # Usage message, then quit.
51 E_NO_OPTS=68 # No command-line args entered.
52 E_NO_URLS=69 # No URLs passed to script.
53 E_NO_SAVEFILE=70 # No save filename passed to script.
54 E_USER_EXIT=71 # User decides to quit.
55
56
57 # Basic default wget command we want to use.
58 # This is the place to change it, if required.
59 # NB: if using a proxy, set http_proxy = yourproxy in .wgetrc.
60 # Otherwise delete --proxy=on, below.