URLToys Tutorial #2: Understanding The Site (Continued)
A Web Gallery of Sequential Images
Let's say that the person making the last gallery decided to be nice, and reorganize those images into a multiple-page thumbnail gallery:
http://urltoys.gotdoofed.com/tut2pics/seq.html
Greaat ... it might be more convenient to look at them in your browser now, but it screws up the plan we had on the last page. The first thing you should notice on this new page is that there are now the thumbnails on the page are actually links to images (findable with the make command). Also, the entire scope of links breaks across multiple thumbnail pages (seq.html through seq4.html). One way to do this page is to add seq.html's URL all the way through seq4.html's URL into URLToys, and do a make. That'd probably work nicely. This requires typing (or at least copying and pasting) 4 links into URLToys, and who wants to do that? Four links isn't a big deal, but if it were a 25 page gallery, that'd be obnoxious. Not to mention that if the site was really slow, you'd have to wait for URLToys to hit the 25 pages worth of HTML to figure out just where the images were. Instead, we're going to use a new command, called seq.
The seq command is very simple. You give it the last URL in an ordered count of them, and it'll find the last number in the URL and "fill-in-the-blanks." In this case, the actual URLs for the images go from:
http://urltoys.gotdoofed.com/tut2pics/image1.jpg
through
http://urltoys.gotdoofed.com/tut2pics/image16.jpg
If you just skim through the pages in your browser, you should quickly realize this. If you ever notice such a sequence, don't even bother with the make or img commands. Instead, use seq.
URLToys (0)> seq http://urltoys.gotdoofed.com/tut2pics/image16.jpg
URLToys (16)> show
http://urltoys.gotdoofed.com/tut2pics/image1.jpg
http://urltoys.gotdoofed.com/tut2pics/image2.jpg
http://urltoys.gotdoofed.com/tut2pics/image3.jpg
http://urltoys.gotdoofed.com/tut2pics/image4.jpg
http://urltoys.gotdoofed.com/tut2pics/image5.jpg
http://urltoys.gotdoofed.com/tut2pics/image6.jpg
http://urltoys.gotdoofed.com/tut2pics/image7.jpg
http://urltoys.gotdoofed.com/tut2pics/image8.jpg
http://urltoys.gotdoofed.com/tut2pics/image9.jpg
http://urltoys.gotdoofed.com/tut2pics/image10.jpg
http://urltoys.gotdoofed.com/tut2pics/image11.jpg
http://urltoys.gotdoofed.com/tut2pics/image12.jpg
http://urltoys.gotdoofed.com/tut2pics/image13.jpg
http://urltoys.gotdoofed.com/tut2pics/image14.jpg
http://urltoys.gotdoofed.com/tut2pics/image15.jpg
http://urltoys.gotdoofed.com/tut2pics/image16.jpg
URLToys (16)>
You can now just get these images.
There is actually a related command to the seq command, called zeq. It acts exactly the same as seq, except it takes all of the digit places of the number it finds, and fills zeros in where appropriate. For example, look at this site:
http://urltoys.gotdoofed.com/tut2pics/zeq.html
This is the same gallery, only the images are named "image001" through "image016". If you tried to use seq on this, you'd end up with "image1" through "image16", which gets you nowhere. However, with zeq, you end up with:
URLToys (0)> zeq http://urltoys.gotdoofed.com/tut2pics/image016.jpg
URLToys (16)> show
http://urltoys.gotdoofed.com/tut2pics/image001.jpg
http://urltoys.gotdoofed.com/tut2pics/image002.jpg
http://urltoys.gotdoofed.com/tut2pics/image003.jpg
http://urltoys.gotdoofed.com/tut2pics/image004.jpg
http://urltoys.gotdoofed.com/tut2pics/image005.jpg
http://urltoys.gotdoofed.com/tut2pics/image006.jpg
http://urltoys.gotdoofed.com/tut2pics/image007.jpg
http://urltoys.gotdoofed.com/tut2pics/image008.jpg
http://urltoys.gotdoofed.com/tut2pics/image009.jpg
http://urltoys.gotdoofed.com/tut2pics/image010.jpg
http://urltoys.gotdoofed.com/tut2pics/image011.jpg
http://urltoys.gotdoofed.com/tut2pics/image012.jpg
http://urltoys.gotdoofed.com/tut2pics/image013.jpg
http://urltoys.gotdoofed.com/tut2pics/image014.jpg
http://urltoys.gotdoofed.com/tut2pics/image015.jpg
http://urltoys.gotdoofed.com/tut2pics/image016.jpg
URLToys (16)>
Even with seq and zeq, you come across some sequences that just don't fit the boundaries of them...
Page 3 -->
|