Created
June 21, 2017 12:15
-
-
Save stefanoverna/1e29201e9f23ae35f0b1603066555b62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "bundler/setup" | |
| require "unsplash" | |
| Unsplash.configure do |config| | |
| config.application_id = "93bf60230c4c3a9eeb002bfbc2b417b473e9afc2c47eda0482e3688934d3eaeb" | |
| config.application_secret = "c1f305a1a625d14a5595f6bf06db5e2895cc751d30ba8515aa5ca611a5436408" | |
| end | |
| counter = 0 | |
| 10.times do | |
| search_results = Unsplash::Photo.random(count: 30) | |
| search_results.each do |photo, i| | |
| counter += 1 | |
| `wget '#{photo.urls.regular}' -O random-#{counter}.jpg` | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source "https://rubygems.org" | |
| gem "unsplash" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment