SHARE
TWEET

Print MIME-header for a given HTTP or HTTPS URI

goebelmasse Dec 10th, 2016 223 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. ########################################################################
  3. #
  4. # mime-header
  5. # Print MIME-header for a given HTTP or HTTPS URI.
  6. #
  7. # Requires lynx.
  8. #
  9. # $Id: mime-header,v 1.2 2016/12/11 00:37:04 elias Exp $
  10. #
  11. ########################################################################
  12.  
  13. # Paranoia line
  14. PATH=/bin:/usr/bin
  15.  
  16. # User-agent
  17. # internet exploiter 10 for best results from spammy sites ;)
  18. UA='Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)'
  19.  
  20. for uri
  21. do
  22.     echo "$uri"
  23.     lynx -useragent="$UA" -mime_header "$uri" 2>&1 |
  24.     sed -e '/^\s*$/q' -e '/^Warning/d' |
  25.     sed -e '/^\s*$/d' -e 's/^/  /'
  26. done
RAW Paste Data
Top