parsed.org

Tips by tag: curl

Ranged Curl by xinu on Jan 15, 2005 02:29 PM

If you have a URL that you need to crawl and you know the range of numbers in the image, you can do something like this:

$ curl -O http://www.example.com/img/samples[00-99].jpg

That should (at least attempt to) fetch the images samples00.jpg through samples99.jpg. Enjoy!

If you're using more than one range, you'll want to build your filename or a path with the --create-dirs option. For example:

$ curl http://www.example.com/imgs[00-99]/samples[00-27].jpg --create-dirs -o "#1/#2.jpg"

Alternatively, you can just be ghetto and name the files like dirname_filename.jpg:

$ curl http://www.example.com/images[00-99]/samples[00-27].jpg -o "#1_#2.jpg"
commandscurlextrasimageshellurl
RSS