REBOL [ Title: "Download Web Page Links" Purpose: { Save items of a particular variety (images, MP3s, etc.) from a web site. } ] system/schemes/default/timeout: 0:10 site: http://www.theonion.com/ start: "archives_content.html" suffix: ".html" save-dir: %savedir tags: make block! 100 ; list of tags page: read join site start parse page [ to "<" some [ copy tag ["<" thru ">"] (append tags tag) | to "<" ] ] web-link-rules: [ "<A" thru "HREF=" [{"} copy link to {"} | copy link to ">"] to end ] foreach tag tags [ if all [ parse tag web-link-rules not find link http:// find link suffix ][ file: second split-path to-url link if not exists? file [ print ["Retrieving: " link] write/binary save-dir/:file read/binary site/:link ] ] ]
Script Junkie | REBOL Bots
Over the past two decades, my search for the perfect scripting language led me to work with companies such as HP, Amiga, and Apple. In that time, I investigated more than 50 different languages, from Ada to C, from Pascal to Lisp. I wanted a language that was very simple and readable with almost no syntax, yet very flexible with a wide degree of expressive freedom.Related Reading
More Insights
INFO-LINK
To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy. | |