The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
wallpaper_swipe.rb

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Francis Hwang

Posts: 130
Nickname: francis
Registered: Jul, 2004

Francis Hwang is the Director of Technology at Rhizome.org.
wallpaper_swipe.rb Posted: Feb 24, 2009 4:48 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Francis Hwang.
Original Post: wallpaper_swipe.rb
Feed Title: Francis Hwang's site: ruby
Feed URL: http://fhwang.net/syndicate/ruby.atom
Feed Description: Author & artist Francis Hwang's personal site.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Francis Hwang
Latest Posts From Francis Hwang's site: ruby

Advertisement

wallpaper_swipe is a quick script that scrapes photos off of The Boston Globe’s “The Big Picture” site and downloads it for use as a desktop wallpaper. It’s geared towards OS X; if anybody wants to patch it for other OSes that’d be cool too.

Setup

1. Run the script once by hand. This will take a long time.

$ ruby wallpaper_swipe.rb

or:

$ LOGGING=true ruby wallpaper_swipe.rb # Lots of log messages
This will download every image it can find based on The Big Picture’s current RSS feed and download it into ~/Pictures/wallpaper_swipe. It will then open that directory in Finder and you can scan through (Cover Flow is great for this). Every image that you like should go into the subdirectory ~/Pictures/wallpaper_swipe/approved.

The reason there’s a manual approval process is that some of TBP’s photos are of, say, a dead child after a terrorist attack: Stirring photography, perhaps, but maybe not something you want as a desktop image. Or pictures of scantily clad people during Carnival, which might be NSFW, depending on where W is.

2. Set your System Preferences to use the “approved” folder for desktop images.

Open System Preferences and go to the Desktop & Screen Saver pane. Add the ~/Pictures/wallpaper_swipe/approved folder to the folder pane on the left (use the ”+” button, or just drag the folder into the folder pane). Select that folder and tweak your settings.

3. Setup a cron to download incremental updates.

After you’ve run the script once, running it again will only download new photos. I set this up to run every day at 4 a.m.:

0 4 * * * cd /Users/francis/Tech/ruby/wallpaper_swipe; /usr/local/bin/ruby wallpaper_swipe.rb

If it downloads any new photos, it will open the ~/Pictures/wallpaper_swipe folder in the Finder again. That way when I get on my computer in the morning I know if I have any new images to sort through.

Comments or patches welcome. And it would be great if nobody used this code to take credit for or profit from TBP’s photos. Most photographers work very hard for not much money, and deserve our consideration.

Read: wallpaper_swipe.rb

Topic: Inheritance, I am Done With You Previous Topic   Next Topic Topic: What's New in Edge Rails: Batched Find

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use