Created
September 9, 2016 04:55
-
-
Save scottjbarr/5b4a4d165669097bfa98c1b258204f93 to your computer and use it in GitHub Desktop.
Grab pictures from the 500px editors RSS feed. Just a quick hacky way of getting new images for my screensaver.
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
| # See https://support.500px.com/hc/en-us/articles/204910987-What-RSS-feeds-are-available- | |
| out=`curl -s https://500px.com/editors.rss` | |
| urls = out.split("\n").select { |url| url.include?("img src") }.map { |s| s.split('"')[3] } | |
| urls.each do |url| | |
| id = url.split("/").last | |
| filename = "#{id}.jpg" | |
| if File.exists?(filename) | |
| puts "#{filename} exists. skipping" | |
| next | |
| end | |
| `wget #{url} -O #{filename}` | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment