SHARE
TWEET

Untitled

a guest Nov 12th, 2009 18,495 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #
  3. #   siteget - Use wget to retrieve a website
  4. #
  5. if [ "$#" -ne "1" ]
  6. then
  7.    echo "$(basename ${0}) <URL>"
  8.    echo ""
  9.    echo "Get a website or book on the web using wget.  It's a one-liner, but"
  10.    echo "it uses a lot of options, so I put it in a script.  Takes one option,"
  11.    echo "a top-level URL."
  12.    exit 1
  13. fi
  14.  
  15. # --mirror gives infinite recursion, follows links ...
  16. # --convert-links converts links for local viewing
  17. # --no-verbose is a relatively quiet (but not silent) mode
  18. # --no-parent won't traverse up the tree - don't know how this combines with
  19. #    "page-requisites," but I hope the latter wins ... (seems to work well)
  20. # --page-requisites get images (inline OR external) for local viewing
  21. # --user-agent sets a user agent string because some sites send empty pages if
  22. #    they don't like wget, so I use the string for what I'll be viewing with
  23. #
  24. wget --mirror --convert-links --no-verbose --no-parent --page-requisites \
  25.    --user-agent="Mozilla/5.0 (compatible; Konqueror/3.0.0/10; Linux)" ${1}
RAW Paste Data
Top