Getting wget on a Mac

  

wget is a standard tool for issuing HTTP requests from a command line. Even with having Indy’s TIdHttp on a Mac now, it might be handy for some tests or scripts to use wget.
The equivalent of
IdHttp.get(‘http://google.com’);
is
wget http://google.com
Unfortunately though wget is not installed by default on MacOSX (only curl is, which is a similar command, with quite a different syntax), but there is an easy way to get wget:
As Delphi developer, using Delphi XE 4′s mobile compiler, you probably already have Xcode (including command line tools) installed – which would be the only requirement for the following. Open a terminal window on your Mac and run the script below. It may take a minute or two and when done wget will be ready to use (it will automatically be copied into one of your bin directories)

curl -O http://ftp.gnu.org/gnu/wget/wget-1.14.tar.gz
tar xvzf wget-1.14.tar.gz
cd wget-1.14
./configure –with-ssl=openssl
make
sudo make install

There might be newer versions than 1.14, but I didn’t check, 1.14 works just fine for me.
Credits: Mike Beach

Tweet This!

Share this on del.icio.us

Digg this!

Share this on Reddit

Get Shareaholic

Comments are closed.