Class: Orange::FlickrResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/orange-flickr/resources/flickr_resource.rb

Instance Method Summary collapse

Instance Method Details

#exposed(packet) ⇒ Object



8
# File 'lib/orange-flickr/resources/flickr_resource.rb', line 8

def exposed(packet); [:galleries, :show]; end


25
26
27
28
29
30
31
# File 'lib/orange-flickr/resources/flickr_resource.rb', line 25

def gallery(packet, opts = {})
  if options["flickr_nsid"]
    sets_url = FlickRaw::URL_PHOTOSTREAM + options["flickr_nsid"] + "/sets"
  else
    false
  end
end

#photosets(packet, opts = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/orange-flickr/resources/flickr_resource.rb', line 15

def photosets(packet, opts = {})
  if FlickRaw.api_key && options["flickr_nsid"]
    ret = {}
    sets = flickr.photosets.getList(:user_id => options["flickr_nsid"])
    sets
  else
    false
  end
end

#stack_initObject



10
11
12
13
# File 'lib/orange-flickr/resources/flickr_resource.rb', line 10

def stack_init
  FlickRaw.api_key = orange.options["flickr_api_key"] || "d25ed6ad71472b633b11544a21da4f36"
  options["flickr_nsid"] = orange.options["flickr_nsid"] || false
end