I wrote this for an assignment done for my brother at Themeforest.
This script/converted exe (Windows only) searches relative directory(directories) for images (*.jpg, *.png) and goes to http://placehold.it for their appropriate placeholder, downloads it, and replaces the original images.
This can be used in two forms.
- Ruby script: you need to download all the gems necessary. Then run in terminal:
ruby placeholder.rb
(NON-WINDOWS) - Exe File: you need to download gem ocra, then create an exe file. (WINDOWS ONLY)
I chose phantomjs because it's headless, and Chrome/Firefox/IE Drivers needs to be added in the path, so that's another hassle.
- Download phantomjs from here.
- Extract phantomjs.exe.
- Keep it in the same folder as placeholder.rb file.
- On Terminal:
brew install phantomjs
On windows you can create an Exe using ocra.
- On cmd, type
gem install ocra
- Then
ocra placeholder.rb
- An .exe file is created. Double click it to run.
On mac, ocra does not work. So:
- On terminal, type
ruby placeholder.rb
#License
Read from Here.