April 26, 2010

347 words 2 mins read

Problem solving: A “normal” person versus a programmer

So here’s the situation: You want to read some manga offline. This manga is not currently available in print, in the United States. So you go online and start searching for it. Search as you might, you can’t find anywhere that lets you download ALL of. Sure, you can get some of the more recent chapters, but not from the beginning. As a consolation prize, you find a site that does serve manga up for online reading. It’s good quality and basically everything you want, but they don’t let you download it. What do you do?

The normal persons solution

You could keep looking for downloads, but you probably won’t find it. You could right-click and save each image individually to your computer, but that will take an IMMENSELY long amount of time. Or you could simply accept that there is no way to read it offline, and read it there on the website.

The programmers solution

You look at the look at the website and HTML source to realize that it would be fairly simple to build a RegEx script to do it for you. You sit down and write a quick script (PHP, or the language of your choice) in less than 30 minutes. The script will find the links it needs to follow, find the locations of the images to download, and download them. It will iterate through every volume, every chapter, and every page. Sequentially downloading THE ENTIRE copy of the posted manga to your local server. Then you’ll FTP it to your personal machine, pack it up and save it as a CBR/CBZ.

Say what?

Obviously I’m posting this because I took the “programmers solution”. It seems very complicated, but to any semi-experienced programmer, it is very simple (took me less than 60 lines of code to execute). Anyone who has been programming for long enough will start to see the programatic solution to all problems. It is strange, but no different than anyone else who’s been spinning a trade for a long time.

By the way, I got my manga ^_^