Using cURL to retrieve multiple URLs from a text file

Posted Tuesday July 22nd 2008 from 53.3123, -6.2335

curl -K params.txt

params.txt:

url = http://tomholland.co.uk/blog
url = http://tomholland.co.uk/about
url = http://tomholland.co.uk/publications
output = file1.html
output = file2.html
output = file3.html

curl -K params.txt

params.txt:

url = http://tomholland.co.uk/{blog}
url = http://tomholland.co.uk/{about}
url = http://tomholland.co.uk/{publications}
output = #1.html
output = #1.html
output = #1.html

Will create files named:

blog.html
about.html
publications.html

Update:

An alternative to the second method:

xargs -n1 curl -o "#1.html" < urls.txt

urls.txt:

http://tomholland.co.uk/{blog}
http://tomholland.co.uk/{about}
http://tomholland.co.uk/{publications}

Will create files named:

blog.html
about.html
publications.html

If you're running Tiger (Mac OS 10.4) or Leopard (Mac OS 10.5) then curl and xargs are there by default (I'm unsure about Jaguar or Panther).

Tagged , and .