joshua-hull/Reddit-Image-Scraper — pull request #10 by aggrolite (2012-03-16 22:28:06+00:00)
Title: make code a bit more defensive

Just some changes (I think mostly to the code I wrote) to ensure your script doesn't puke. I just learned recently about how using map in void context is a no-no, as it returns values.

-ensure our variables are defined
-wrap json decode in eval
-don't use map in void context, use for loop instead
-trim trailing whitespace (vim does this automatically for me)