Saturday, April 24, 2004

It's the recursion, stupid

I think my life just changed. For anyone who's read enough of this site, you know that what I'm about to talk about isn't earth-shattering. Far from important. Sure, you could argue that in the grand scheme of things, nothing that happens to anyone is important. This, however, is some real stupid shit. And... I'm pathetic.

So we all know about my infamous porn-fetching scripts. They're all pretty simple-minded; basically just a "for" loop that constructs URLs to go and download from the loop index. The heart of the scripts is a separate utility that I didn't write called Wget (probably installed by default on a lot of Linux systems). Wget in it's most basic usage, not surprisingly, takes a URL and retrieves it. As such, my script does its counting and URL building, and just tells Wget to go and get said URLs. One problem I have been plagued with is that some sites forbid direct linking to images (which is typically what the scripts are used for, but they can be easily modified to get any kind of file), thus requiring you to go to an index page and click the link to every image you want and then save it. I understand why some sites would want to do this, but it's still a huge pain in the ass.

I was looking though my dozens of bookmarks for shit that's "to be downloaded" and came across a bookmarked site full of pics of this girl, AV (adult video, aka PORN for the euphemism impaired) actress Kanazawa Bunko. And I was asking myself, "Why the fuck haven't you downloaded these? There's some quality shit here." The reason was, of course, that my script couldn't download the images because of the above mentioned issue, and as such I'd have to download them manually. I thought about it some more, and I was like, you know, Wget has to be able to handle this.

As it turns out, Wget is all over that shit. I can give Wget a URL, bust out the '-r' option, and it'll go retrieve a page and shit that it's linked to, including all of the images linked off a page. Fucking sweet.

Of course, this means that I have been wasting so much fucking time over the past several years both manually downloading shit as well as writing scripts for shit that Wget can already do. This is great from here on out, but looking back I'm rather pissed at myself for not just reading the fucking man page sooner. I mean, think of all the time I could have saved if I had known this. In theory, I could have gotten through my porn downloading sooner, and used the extra time to go out and build an actual social life. Of course, let's face it, I would have just used that time to download more porn.

Yes, yes, yes. I know what you guys are out there are saying. "Yeah, that's great, only it isn't. What the fuck is the page you were talking about earlier with all the pictures?" Here, quit yer bitching. Yes, there are some naked pictures there, so click with caution.