View Single Post
Old 02-11-2005, 01:15 AM   #1
hacker
Technology Mercenary
hacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with othershacker plays well with others
 
hacker's Avatar
 
Posts: 617
Karma: 2561
Join Date: Feb 2003
Location: East Lyme, CT
Device: Direct Neural Implant
MapQuester World Atlas Conversion Tool

As promised over here, I've taken some time to clean up and cannibalize part of a spider I use daily for Plucker, and modified it to allow you to run it and spider MapQuest to build yourself a World Atlas with images, country data, and lots of other bits.

The whole script is only 87 lines of actual code! (161 with comments and liberal spacing for readibility) I prefer writing clean, tight, well-commented code. My code is my business card, and this is no exception.

The script is written in Perl, my language of choice, but all modules used are either in core, or available via CPAN (perl -MCPAN -e 'install "Module::Name"'). It should be easy to run and figure out. I've commented it where required.
My only requirement of using this, is that you don't rip off the code and claim you wrote it, or parts of it, and that you provide some feedback so I can improve it; good, bad, feature requests, bugs you find, whatever. I'd like to know!
Unfortunately, I cannot redistribute the completed version of the maps in mobile format, because that would violate MapQuest's copyright and Terms of Use, but you can see how good it looks in the screenshots below.

The entire script is attached below. Just grab the script and run it in an empty directory. It will spider and fetch the 238-or-so separate pages from MapQuest's World Atlas pages, strip out the unnecessary HTML, Javascript, stylesheets, and other non-visible bits, and write each country to its own file. All of the external links to country data is rewritten to reference the local copies. The only pieces fetched remotely are the images themselves.

When the spidering is complete, it outputs a top-level index file for you to point your mobile creation tool towards, so you can then spider the content yourself, and convert it to the format of your choice.

Hopefully many users will find this useful. Enjoy!
Attached Thumbnails
Click image for larger version

Name:	01.png
Views:	817
Size:	26.2 KB
ID:	514   Click image for larger version

Name:	02.png
Views:	732
Size:	39.7 KB
ID:	515   Click image for larger version

Name:	03.png
Views:	790
Size:	17.6 KB
ID:	516   Click image for larger version

Name:	04.png
Views:	687
Size:	43.9 KB
ID:	517   Click image for larger version

Name:	05.png
Views:	827
Size:	62.3 KB
ID:	518  
Attached Files
File Type: txt mapquester.txt (4.4 KB, 628 views)

Last edited by hacker; 02-11-2005 at 01:58 AM.
hacker is offline   Reply With Quote