MiniCrawler is a tiny examplescript that does only two things:
- it will go to a particular web page, fetch all the links from that web page, and display those links in your browser;
- it will go to a particular web page, fetch all the links to images on that page, and display those images in your browser.
It's only a few lines long because it relies on the magic of Simple HTML Dom, which is nearly 1,000 lines long and has many prewritten features and functions that make it go. Nonetheless, it's a great intro for journalists to show them just how simple using a scraper can be. Scrapers are great for fetching public data out of websites.
I post learn-to-code resources for journalists at Life and Code: What I Learned About Life from Programming: [http://lifeandcode.tumblr.net].