Skip to content

Instantly share code, notes, and snippets.

@scottjbarr
Created September 9, 2016 04:55
Show Gist options
  • Select an option

  • Save scottjbarr/5b4a4d165669097bfa98c1b258204f93 to your computer and use it in GitHub Desktop.

Select an option

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.
# 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