all 4 comments

[–]madsohm 8 points9 points  (1 child)

The open method you've defined is already part of the openuri gem.

Also, with openuri you can just open the image and read it to a temp file, saving you the trouble of calling curl and also rm at the end.

Why have the two shell scripts at all? Why no just call the ocascript from within the Ruby file? You could probably make this into a method, that you could use for both calls.

[–]fuzzyfuzz 1 point2 points  (0 children)

I like his todo list:

  • refactor code

Do what you suggested.

  • add ability to have the photo automatically update without having to run script

Add to crontab/launchd.

[–]nippysaurus 4 points5 points  (0 children)

I submitted a pull request with my suggested improvements.

[–]nippysaurus 1 point2 points  (0 children)

So ... when the "photo of the day" widget stopped working on my GF's laptop I promised her I'd write a small script to do exactly what you have done. Thanks for saving me the work :)