xkcd.com ripper
Posted: Sun Aug 25, 2013 6:59 am
I enjoy web comics and wanted to have the full archive of xkcd.com in my archive, so here is the script I used to grab the images.. Just thought I would share incase anyone else is interested in it as well..
Code: Select all
on mouseUp
constant xkcd = "http://xkcd.com/"
constant ImageUrlForHotLinking = "Image URL (for hotlinking/embedding): "
local tData
local tRemotePath
local tLocalPath
answer folder "Select a folder to save the images to:" as sheet
if (it <> EMPTY) then
put it into tLocalPath
repeat with i = 1 to 1255
put URL (xkcd & i & SLASH) into tData
local tLineOffset
put lineOffset(ImageUrlForHotLinking, tData) into tLineOffset
put line tLineOffset of tData into tRemotePath
replace ImageUrlForHotLinking with EMPTY in tRemotePath
local tFileName
set the itemDelimiter to SLASH
put i & " - " & item -1 of tRemotePath into tFileName
put URL tRemotePath into URL ("binfile:" & tLocalPath & SLASH & tFileName)
end repeat
end if
end mouseUp