Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on wget (and curl).
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/wget.e>
#           or at <http://angg.twu.net/e/wget.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.wget_patch_potato»		(to "wget_patch_potato")
# «.accept-and-reject»		(to "accept-and-reject")
# «.user-agent»			(to "user-agent")
# «.wget-flv-player»		(to "wget-flv-player")
# «.--no-check-certificate»	(to "--no-check-certificate")
# «.overwriting»		(to "overwriting")
# «.recursive»			(to "recursive")
# «.curl»			(to "curl")




#####
#
# wget (potato)
# 2000jun04
#
#####

# (find-status "wget")
# (find-vldifile "wget.list")
# (find-fline "/usr/doc/wget/")
# (find-fline "/usr/doc/wget/NEWS.gz" ".wgetrc")

# (find-node "(wget)Top")
# (find-node "(wget)Download Options")
# (find-node "(wget)Download Options" "timeout")
# (find-fline "~/.wgetrc")





#####
#
# my patch for wget, for potato
# 2000apr03
#
#####

# «wget_patch_potato»  (to ".wget_patch_potato")

# (find-fline "$SDEBIAN/ls-lR.i" "potato/main/source/web/wget")
# Note that the .orig.tar.gz is the same as slink's.

# Trick to generates a .deb with a different version:
# (find-packfile "packaging.text.gz" "changelog")
# (find-packfile "packaging.text.gz" "\n3.2.3. `debian/changelog'")

# (find-es "slink" "wget_patch")
#*
pdsc $SDEBIAN/dists/potato/main/source/web/wget_1.5.3-3.dsc
cd /usr/src/wget-1.5.3/src/
patch url.c <<'--%%--'
59c59
< # define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033"
---
> # define URL_UNSAFE " <>\"#%{}|\\^[]`@:\033" /* Edrx: removed "~" */
--%%--
cd /usr/src/wget-1.5.3/debian/
patch changelog <<'--%%--'
0a1,6
> wget (1.5.3-3edrx) unstable; urgency=low
> 
>   * Removed "~" from URL_UNSAFE.
>   
>  -- Eduardo Ochs <edrx@mat.puc-rio.br>  Tue, 3 Apr 2000 20:00:00 -0300
> 
--%%--

cd /usr/src/wget-1.5.3/
etags src/*.[ch]
debian/rules binary	|& tee odrb

#*
mv -iv /usr/src/wget*deb /usr/src/.debs/
dpkg -i /usr/src/.debs/wget_1.5.3-3edrx_i386.deb





######
#
# wget 1.5.3 (slink, with patch)
#
######

# «wget_patch»

# For more on wget hacking, see:
# (find-es "net" "wget_hacking")

pdsc /big/slinks2/dists/slink/main/source/web/wget_1.5.3-1.1.dsc
cd /usr/src/wget-1.5.3/src/
patch url.c <<'--%%--'
59c59
< # define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033"
---
> # define URL_UNSAFE " <>\"#%{}|\\^[]`@:\033" /* Edrx: removed "~" */
--%%--
cd /usr/src/wget-1.5.3/
etags src/*.[ch]
debian/rules binary	|& tee odrb
mv -iv /usr/src/wget*deb /usr/src/.debs/
apt-update

cd /usr/src/.debs/
dpkg -i wget_1.5.3-1.1_i386.deb





#######
#
# wget 1.5.2
#
#######

cd /usr/src/
rm -Rv wget-1.5.2/
tar -xvzf /snarf/http/sunsite.auc.dk/ftp/pub/infosystems/wget/wget-1.5.2.tar.gz
cd /usr/src/wget-1.5.2/
./configure --disable-nls --prefix=/usr |& tee oc
#
# lynx doesn't like "~" as "%7E", remove it from URL_UNSAFE
# (find-fline "/usr/src/wget-1.5.2/src/url.c" "URL_UNSAFE")
#
make |& tee om
cd /usr/src/wget-1.5.2/
make install |& tee omi

# (find-wgfile "src/url.c" "convert_links")





#######
#
# wget 1.5.2: bug on RH, "Cannot determine user-id."
#
#######

cd /usr/src/wget-1.5.2/src/
gcc -I. -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/etc/wgetrc\" -DLOCALEDIR=\"/usr/share/locale\" -Wall -Wno-implicit -E host.c > host.E
# (find-wgfile "src/host.E" "Cannot")
# (find-wgfile "src/utils.c" "pwd_cuserid")


cd ~/C/
cat > pwuid.c <<'---'
#include <pwd.h>
#include <sys/types.h>
#include <stdio.h>
main() {
  struct passwd *pwd;
  pwd = getpwuid (getuid ());
  printf("%d\n", pwd);
  if (!pwd || !pwd->pw_name)
    exit(1);
  printf("%s\n", pwd->pw_name);
}
---
gcc -o pwuid pwuid.c
./pwuid




#######
#
# wget 1.5.3 (on boto)
#
#######

psne ftp://sunsite.auc.dk/pub/infosystems/wget/wget-1.5.3.tar.gz

cd $USRC/
rm -Rv wget-1.5.3/
tar -xvzf $S/ftp/sunsite.auc.dk/pub/infosystems/wget/wget-1.5.3.tar.gz
cd $USRC/wget-1.5.3/
./configure --disable-nls --prefix=/usr |& tee oc
#
# lynx doesn't like "~" as "%7E", remove it from URL_UNSAFE
# (find-fline  "$USRC/wget-1.5.3/src/url.c" "URL_UNSAFE")
# (find-fline "$BUSRC/wget-1.5.3/src/url.c" "URL_UNSAFE")
#
cd $USRC/wget-1.5.3/
make |& tee om

cp src/wget ~/bin-Linux/




######
#
# wget 1.5.3 (slink) - hacking
#
######

# «wget_hacking»

# The basic patch is at:
# (find-es "slink" "wget_patch")

# Check that apt installed the patched version.
# (find-fline "/usr/src/.debs/")
# (find-vldifile "wget.postinst")

# How I got the input for "patch":
#cd /usr/src/wget-1.5.3/src/; cp -iv url.c url.c~
# lynx doesn't like "~" as "%7E", remove it from URL_UNSAFE
# (find-wgfile "src/url.c" "URL_UNSAFE")
#diff url.c~ url.c | tee ~/o

#
# Now for some heavier debugging.
#

# (find-fline "~/GDB/.gdbinit.wget")
# (gdb "gdb -x ~/GDB/.gdbinit.wget")

cd /snarf/http/
wget -r -nc -k http://hypatia.dcs.qmw.ac.uk/html/authors.html

# (find-wgtag "convert_links")
# (find-wgtag "convert_all_links")





#####
#
# accepting and rejecting
# 2004oct18
#
#####

# «accept-and-reject»  (to ".accept-and-reject")
#*
# (find-node "(wget)Types of Files")
rm -Rv /tmp/wgetish/
mkdir  /tmp/wgetish/
cd     /tmp/wgetish/
wget -r -R "*.deb" -R "*\\?*" http://127.0.0.1/

#*
# It still downloads all the things like "index.html?N=A", so maybe
# it's better to remove them by hand after the full download




#####
#
# user-agent
# 2005mar16
#
#####

# «user-agent»  (to ".user-agent")
# (find-es "http" "disguise-user-agent")
# (find-node "(wget)HTTP Options" "`--user-agent=AGENT-STRING'")



#####
#
# save-cookies and post-data
# 2006aug13
#
#####

# (find-node "(wget)HTTP Options" "wget --save-cookies cookies.txt")
# (find-node "(wget)HTTP Options" "--post-data 'user=foo&password=bar'")





#####
#
# wget 1.10.2 (for flv-player?)
# 2007apr08
#
#####

# «wget-flv-player»  (to ".wget-flv-player")
# http://ftp.debian.org/debian/pool/main/w/wget/
# http://ftp.debian.org/debian/pool/main/w/wget/wget_1.10.2-2.dsc
# http://ftp.debian.org/debian/pool/main/w/wget/wget_1.10.2-2.diff.gz
# http://ftp.debian.org/debian/pool/main/w/wget/wget_1.10.2.orig.tar.gz
#*
rm -Rv ~/usrc/wget/
mkdir  ~/usrc/wget/
cd $S/http/ftp.debian.org/debian/pool/main/w/wget/
cp -v wget_1.10.2* ~/usrc/wget/
cd     ~/usrc/wget/
dpkg-source -sn -x wget_1.10.2-2.dsc
cd     ~/usrc/wget/wget-1.10.2/
dpkg-buildpackage -us -uc -b -rfakeroot     -d    |& tee odb

#*
# (code-c-d "wget" "~/usrc/wget/wget-1.10.2/")
# (find-wgetfile "")
# (find-wgetfile "debian/control" "libssl-dev (>= 0.9.8-1)")
# (find-status "libssl-dev")

# http://www.martijndevisser.com/blog/article/flv-player-updated
# http://www.martijndevisser.com/download/flvplayer/flvplayer_sources.zip



#####
#
# --no-check-certificate
# 2007dec13
#
#####

# «--no-check-certificate»  (to ".--no-check-certificate")
# (find-angg ".wgetrc")




#####
#
# overwriting
# 2011dec29
#
#####

# «overwriting»  (to ".overwriting")
# (find-sh "wget -h")
# (find-sh "wget -h" "-nc, --no-clobber")
# (find-sh "wget -h" "-N,  --timestamping")
# (find-wgetnode "Download Options" "`--no-clobber'")
# (find-wgetnode "Download Options" "`--timestamping'")
# (find-wgetnode "Time-Stamping")




#####
#
# recursive
# 2013feb23
#
#####

# «recursive» (to ".recursive")
# (find-wgetnode "Recursive Download")
# (find-wgetnode "Directory-Based Limits" "`--no-parent'")
# (find-angg ".zshrc" "psne")
# (find-angg ".zshrc" "psne" "psner")




#####
#
# curl
# 2017jul13
#
#####

# «curl» (to ".curl")
# (find-man "1 curl")
# (find-man "1 curl" "-O, --remote-name")
# https://mail.google.com/mail/ca/u/0/#search/yamauti/15beed9316009cee




#####
#
# dots
#
#####

# (find-node "(wget)Top")
# (find-man "1 wget" "--progress=type")
# (find-node "(wget)Download Options" "--progress=TYPE")



libssl-dev






#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: