{"id":37,"date":"2002-08-07T23:12:52","date_gmt":"2002-08-08T03:12:52","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=37"},"modified":"2002-08-07T23:12:52","modified_gmt":"2002-08-08T03:12:52","slug":"wget","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2002\/08\/07\/wget\/","title":{"rendered":"wget"},"content":{"rendered":"<p>As part of the site I&#8217;m working on, we&#8217;re offering a customizable weather swf that gets syndicated weather from <a href=\"http:\/\/www.intellicast.com\/\">intellicast<\/a>.  Intellicast posts their weather downloads as a <a href=\"http:\/\/www.gzip.org\/\">GZIP<\/a> xml file every 3 hours during business hours and they recommend that you use <a href=\"http:\/\/www.wget.org\/\">wget<\/a> to retrieve the file. Turns out wget is a pretty cool little piece of software, albeit with spotty directions for Windows users.  Here&#8217;s how to install and use wget on a Windows machine if you&#8217;re curious:<\/p>\n<p>a) Download <a href=\"http:\/\/ftp.sunsite.dk\/projects\/wget\/windows\/wget-1.8.1b.zip\">v1.8.1<\/a> from <a href=\"http:\/\/space.tin.it\/computer\/hherold\/\">http:\/\/space.tin.it\/computer\/hherold\/<\/a>.  Why not 1.8.2?  I got errors when trying to use it&#8230; <\/p>\n<p>b) Unzip the files to a location on your computer.  <\/p>\n<p>c) Create a text file called &#8220;config.wgetrc&#8221;.  Open up the included HTML helper page and cruise to the &#8220;Sample Wgetrc&#8221; section and copy the sample config to your text file.  Save this file.<\/p>\n<p>d) Add a System Variable (right click &#8216;My Computer&#8217; &#8211;&gt; Properties &#8211;&gt; Advanced &#8211;&gt; Environment Variables &#8211;&gt; New).  The variable name should be &#8216;wgetrc&#8217; and the value should be the path AND file name to the file you created in step c (ie: variable value = &#8216;c:\\wget\\config.wgetrc&#8217; if you used the file name I suggested).<\/p>\n<p>e) Bring up a command prompt (Start &#8211;&gt; Run &#8211;&gt; type &#8216;cmd&#8217;).  Cruise over to your wget directory (on my computer: c:\\wget).  Type &#8216;wget http:\/\/cephas.net\/&#8217;.<\/p>\n<p>f) You&#8217;re done! You&#8217;ve successfully retrieved my homepage!  Notice the file created in the wget directory.  <\/p>\n<p>My illustration was very simple, you can do much so much more than just retrieving one web page.  It&#8217;s real power is illustrated when you need to retrieve an entire website (for archiving or mirroring purposes) or a large file (ie: a 10MB XML file) among other things.  Here are some other sample commands:<\/p>\n<p><b>Saving a file\/site to a different directory<\/b><br \/>\n&#8216;wget -O c:\\mydirectory\\newfile.html http:\/\/www.cephas.net\/&#8217;<\/p>\n<p><b>Retrieve all the gifs from a directory (directory browsing must be on)<\/b><br \/>\n&#8216;wget -r -l1 &#8211;no-paren -A.gif http:\/\/www.server.com\/images\/&#8217;<\/p>\n<p><b>Mirror your website<\/b><br \/>\nwget &#8211;mirror http:\/\/www.yoursite.com\/<\/p>\n<p>For complete syntax and more examples, check the wget.html file that was zipped w\/ the source.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the site I&#8217;m working on, we&#8217;re offering a customizable weather swf that gets syndicated weather from intellicast. Intellicast posts their weather downloads as a GZIP xml file every 3 hours during business hours and they recommend that you use wget to retrieve the file. Turns out wget is a pretty cool little &hellip; <a href=\"https:\/\/cephas.net\/blog\/2002\/08\/07\/wget\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">wget<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/37"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}