iNko Posted March 20, 2013 Share Posted March 20, 2013 There is this url - http://xkcd.com/1110/ . It has an interactive image, witch is made out of 225 other images (its very big). I want to make a php script that would download all those 225 images. For example - http://imgs.xkcd.com/clickdrag/1n8w.png. 1n8w.png is one of those images, if i write 1n9w.png it would load another image. I think i do not explain myself well enough, so i am going to post how other ppl got the images but using other method: This is what I did: I figured out, that the map pieces follow the URL pattern http://imgs.xkcd.com/clickdrag/X[n|s]Y[e|w].png,where n, s, e, w are characters to select the quadrant, and X and Y are positive integers (>=1) with no zero padding. The images are each 2048×2048 pixels in size and are arranged in an orthogonal grid. The bounds can be found in the JavaScript file http://imgs.xkcd.com/clickdrag/1110.js:var size=[14, 48, 25, 33];These are the bounds of [n, e, s, w] respectively, however, I did only find images for [13, 48, 19, 33], a little bit less in the n-s direction, but maybe I was missing something. I did a brute force download of all the images (sorry Randall) using simple DOS shell commands like this for the s-e-quadrant:FOR /L %x IN (1,1,25) DO FOR /L %y IN (1,1,48) DO wget http://imgs.xkcd.com/clickdrag/%xs%ye.pngI got 225 files that existed, all others are completely black or white and returned a 404-Not found. I do not know what DOS shell is, or what those command lines are, i do understand what that code does tho. Is it possible to make something like this but with php? Link to comment https://forums.phpfreaks.com/topic/275928-retrieving-all-images-from-url-xkcd-1110/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.