Created
November 10, 2013 18:35
-
-
Save ceneon/7401982 to your computer and use it in GitHub Desktop.
Get pictures from Flickr into an Apple TV
This file contains 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
#! /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby | |
require 'flickraw' | |
require 'airplay' | |
FlickRaw.api_key = 'API_KEY' | |
FlickRaw.shared_secret = 'API_SECRET' | |
atv = Airplay.devices.first | |
results = flickr.photos.search(:tags => ARGV[0]) | |
for x in 1..results.length do | |
rand = Random.new.rand(results.length) | |
info = flickr.photos.getInfo(:photo_id => results[rand].id) | |
url = FlickRaw.url_b(info) | |
atv.view(url, :transition => "Dissolve") | |
sleep(5) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment