Skip to content

Instantly share code, notes, and snippets.

@ceneon
Created November 10, 2013 18:35
Show Gist options
  • Save ceneon/7401982 to your computer and use it in GitHub Desktop.
Save ceneon/7401982 to your computer and use it in GitHub Desktop.
Get pictures from Flickr into an Apple TV
#! /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