caboodle 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -7,7 +7,7 @@ module Caboodle
7
7
  end
8
8
 
9
9
  declare "photosets" do |r|
10
- r.url = "http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=#{Site.flickr_api_key}&user_id=#{Site.flickr_user_id}"
10
+ r.url = "http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=#{Site.flickr_api_key}&user_id=#{FlickrAPI.flickr_user_id}"
11
11
  r.via = :get
12
12
  end
13
13
 
@@ -30,6 +30,16 @@ module Caboodle
30
30
  Caboodle.mash(new.photosets).rsp.photosets.photoset
31
31
  end
32
32
 
33
+ def self.flickr_user_id
34
+ return Site.flickr_user_id unless Site.flickr_user_id.blank?
35
+ url = "http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fisithackday.com%2Fapi%2Fflickr.whois.xml%22%20as%20flickr.whois%3Bselect%20*%20from%20flickr.whois%20where%20owner%3D%22#{Site.flickr_username}%22&format=xml"
36
+ doc = Nokogiri::XML.parse(open(url))
37
+ val = doc.css("owner").first.attributes["nsid"].value
38
+ Site.flickr_user_id = val
39
+ Caboodle::Kit.dump_config
40
+ Site.flickr_user_id
41
+ end
42
+
33
43
  end
34
44
 
35
45
  class Flickr < Caboodle::Kit
@@ -55,7 +65,7 @@ module Caboodle
55
65
  haml :photography
56
66
  end
57
67
 
58
- required [:flickr_username, :flickr_user_id, :flickr_api_key]
68
+ required [:flickr_username, :flickr_api_key]
59
69
 
60
70
  menu "Photography", "/photography"
61
71
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboodle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - steflewandowski