flickr.rb 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.txt +7 -4
  3. data/Gemfile.lock +3 -3
  4. data/README.md +5 -1
  5. data/Rakefile +6 -7
  6. data/doc/Flickr.html +1813 -0
  7. data/doc/Flickr/Config.html +468 -0
  8. data/doc/Flickr/Group.html +974 -0
  9. data/doc/Flickr/Photo.html +2467 -0
  10. data/doc/Flickr/PhotoCollection.html +529 -0
  11. data/doc/Flickr/Photoset.html +942 -0
  12. data/doc/Flickr/User.html +1672 -0
  13. data/doc/_index.html +190 -0
  14. data/doc/class_list.html +54 -0
  15. data/doc/css/common.css +1 -0
  16. data/doc/css/full_list.css +57 -0
  17. data/doc/css/style.css +339 -0
  18. data/doc/file.Changelog.html +73 -0
  19. data/doc/file.LICENSE.html +94 -0
  20. data/{rdoc/README_md.html → doc/file.README.html} +85 -121
  21. data/doc/file_list.html +62 -0
  22. data/doc/frames.html +26 -0
  23. data/doc/index.html +216 -0
  24. data/doc/js/app.js +219 -0
  25. data/doc/js/full_list.js +178 -0
  26. data/doc/js/jquery.js +4 -0
  27. data/doc/method_list.html +725 -0
  28. data/doc/top-level-namespace.html +112 -0
  29. data/flickr.gemspec +3 -3
  30. data/lib/flickr.rb +1 -1
  31. metadata +27 -46
  32. data/rdoc/Flickr.html +0 -1044
  33. data/rdoc/Flickr/Config.html +0 -300
  34. data/rdoc/Flickr/Group.html +0 -373
  35. data/rdoc/Flickr/Photo.html +0 -1427
  36. data/rdoc/Flickr/PhotoCollection.html +0 -261
  37. data/rdoc/Flickr/Photoset.html +0 -389
  38. data/rdoc/Flickr/User.html +0 -775
  39. data/rdoc/created.rid +0 -3
  40. data/rdoc/images/add.png +0 -0
  41. data/rdoc/images/arrow_up.png +0 -0
  42. data/rdoc/images/brick.png +0 -0
  43. data/rdoc/images/brick_link.png +0 -0
  44. data/rdoc/images/bug.png +0 -0
  45. data/rdoc/images/bullet_black.png +0 -0
  46. data/rdoc/images/bullet_toggle_minus.png +0 -0
  47. data/rdoc/images/bullet_toggle_plus.png +0 -0
  48. data/rdoc/images/date.png +0 -0
  49. data/rdoc/images/delete.png +0 -0
  50. data/rdoc/images/find.png +0 -0
  51. data/rdoc/images/loadingAnimation.gif +0 -0
  52. data/rdoc/images/macFFBgHack.png +0 -0
  53. data/rdoc/images/package.png +0 -0
  54. data/rdoc/images/page_green.png +0 -0
  55. data/rdoc/images/page_white_text.png +0 -0
  56. data/rdoc/images/page_white_width.png +0 -0
  57. data/rdoc/images/plugin.png +0 -0
  58. data/rdoc/images/ruby.png +0 -0
  59. data/rdoc/images/tag_blue.png +0 -0
  60. data/rdoc/images/tag_green.png +0 -0
  61. data/rdoc/images/transparent.png +0 -0
  62. data/rdoc/images/wrench.png +0 -0
  63. data/rdoc/images/wrench_orange.png +0 -0
  64. data/rdoc/images/zoom.png +0 -0
  65. data/rdoc/index.html +0 -92
  66. data/rdoc/js/darkfish.js +0 -155
  67. data/rdoc/js/jquery.js +0 -18
  68. data/rdoc/js/navigation.js +0 -142
  69. data/rdoc/js/search.js +0 -94
  70. data/rdoc/js/search_index.js +0 -1
  71. data/rdoc/js/searcher.js +0 -228
  72. data/rdoc/rdoc.css +0 -595
  73. data/rdoc/table_of_contents.html +0 -241
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!top-level-namespace.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+
36
+
37
+ <span class="title">Top Level Namespace</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Top Level Namespace
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ </dl>
82
+ <div class="clear"></div>
83
+
84
+ <h2>Defined Under Namespace</h2>
85
+ <p class="children">
86
+
87
+
88
+
89
+
90
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Flickr.html" title="Flickr (class)">Flickr</a></span>
91
+
92
+
93
+ </p>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ </div>
104
+
105
+ <div id="footer">
106
+ Generated on Tue May 13 13:49:25 2014 by
107
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
+ 0.8.7.4 (ruby-2.0.0).
109
+ </div>
110
+
111
+ </body>
112
+ </html>
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'flickr.rb'
3
- s.version = '1.2.0'
3
+ s.version = '1.2.1'
4
4
  s.authors = ['Scott Raymond, Patrick Plattes, Rafal Piekarski']
5
5
  s.autorequire = 'flickr.rb'
6
- s.date = '2014-05-13'
6
+ s.date = '2014-06-29'
7
7
  s.email = 'ravbaker@gmail.com'
8
8
  s.files = Dir.glob("**/*").delete_if { |item| item.include?(".git") || item[/^pkg/] }
9
9
  s.homepage = 'http://github.com/RaVbaker/flickr/'
@@ -30,6 +30,6 @@ Gem::Specification.new do |s|
30
30
  end
31
31
 
32
32
  s.add_development_dependency 'rake'
33
- s.add_development_dependency 'rdoc'
33
+ s.add_development_dependency 'yard'
34
34
  s.add_development_dependency 'mocha'
35
35
  end
@@ -188,7 +188,7 @@ class Flickr
188
188
  http.verify_mode = (@verify_ssl ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE)
189
189
  http.ca_file = @ca_file if @ca_file
190
190
  http.start do |res|
191
- res.request_get(url).body.to_s
191
+ res.request_get(url.request_uri).body.to_s
192
192
  end
193
193
  end
194
194
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Raymond, Patrick Plattes, Rafal Piekarski
8
8
  autorequire: flickr.rb
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rdoc
42
+ name: yard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '>='
@@ -73,6 +73,29 @@ extensions: []
73
73
  extra_rdoc_files: []
74
74
  files:
75
75
  - Changelog.txt
76
+ - doc/_index.html
77
+ - doc/class_list.html
78
+ - doc/css/common.css
79
+ - doc/css/full_list.css
80
+ - doc/css/style.css
81
+ - doc/file.Changelog.html
82
+ - doc/file.LICENSE.html
83
+ - doc/file.README.html
84
+ - doc/file_list.html
85
+ - doc/Flickr/Config.html
86
+ - doc/Flickr/Group.html
87
+ - doc/Flickr/Photo.html
88
+ - doc/Flickr/PhotoCollection.html
89
+ - doc/Flickr/Photoset.html
90
+ - doc/Flickr/User.html
91
+ - doc/Flickr.html
92
+ - doc/frames.html
93
+ - doc/index.html
94
+ - doc/js/app.js
95
+ - doc/js/full_list.js
96
+ - doc/js/jquery.js
97
+ - doc/method_list.html
98
+ - doc/top-level-namespace.html
76
99
  - flickr.gemspec
77
100
  - Gemfile
78
101
  - Gemfile.lock
@@ -81,49 +104,6 @@ files:
81
104
  - LICENSE
82
105
  - Manifest.txt
83
106
  - Rakefile
84
- - rdoc/created.rid
85
- - rdoc/Flickr/Config.html
86
- - rdoc/Flickr/Group.html
87
- - rdoc/Flickr/Photo.html
88
- - rdoc/Flickr/PhotoCollection.html
89
- - rdoc/Flickr/Photoset.html
90
- - rdoc/Flickr/User.html
91
- - rdoc/Flickr.html
92
- - rdoc/images/add.png
93
- - rdoc/images/arrow_up.png
94
- - rdoc/images/brick.png
95
- - rdoc/images/brick_link.png
96
- - rdoc/images/bug.png
97
- - rdoc/images/bullet_black.png
98
- - rdoc/images/bullet_toggle_minus.png
99
- - rdoc/images/bullet_toggle_plus.png
100
- - rdoc/images/date.png
101
- - rdoc/images/delete.png
102
- - rdoc/images/find.png
103
- - rdoc/images/loadingAnimation.gif
104
- - rdoc/images/macFFBgHack.png
105
- - rdoc/images/package.png
106
- - rdoc/images/page_green.png
107
- - rdoc/images/page_white_text.png
108
- - rdoc/images/page_white_width.png
109
- - rdoc/images/plugin.png
110
- - rdoc/images/ruby.png
111
- - rdoc/images/tag_blue.png
112
- - rdoc/images/tag_green.png
113
- - rdoc/images/transparent.png
114
- - rdoc/images/wrench.png
115
- - rdoc/images/wrench_orange.png
116
- - rdoc/images/zoom.png
117
- - rdoc/index.html
118
- - rdoc/js/darkfish.js
119
- - rdoc/js/jquery.js
120
- - rdoc/js/navigation.js
121
- - rdoc/js/search.js
122
- - rdoc/js/search_index.js
123
- - rdoc/js/searcher.js
124
- - rdoc/rdoc.css
125
- - rdoc/README_md.html
126
- - rdoc/table_of_contents.html
127
107
  - README.md
128
108
  - test/flickr_test.rb
129
109
  - TODO
@@ -154,3 +134,4 @@ specification_version: 2
154
134
  summary: 'An insanely easy interface to the Flickr photo-sharing service. Also available
155
135
  as a Rails plugin! By Scott Raymond. Maintainer: Rafal Piekarski'
156
136
  test_files: []
137
+ has_rdoc:
@@ -1,1044 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
-
7
- <title>class Flickr - Flickr</title>
8
-
9
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
-
11
- <script type="text/javascript">
12
- var rdoc_rel_prefix = "./";
13
- </script>
14
-
15
- <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
-
22
-
23
- <body id="top" class="class">
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="./index.html">Home</a>
28
- <a href="./table_of_contents.html#classes">Classes</a>
29
- <a href="./table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
32
-
33
-
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
35
- <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
38
- title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
41
-
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
44
-
45
-
46
-
47
-
48
- <div id="file-metadata">
49
- <nav id="file-list-section" class="section">
50
- <h3 class="section-header">Defined In</h3>
51
- <ul>
52
- <li>lib/flickr.rb
53
- </ul>
54
- </nav>
55
-
56
-
57
- </div>
58
-
59
- <div id="class-metadata">
60
-
61
- <nav id="parent-class-section" class="section">
62
- <h3 class="section-header">Parent</h3>
63
-
64
- <p class="link">Object
65
-
66
- </nav>
67
-
68
-
69
-
70
- <!-- Method Quickref -->
71
- <nav id="method-list-section" class="section">
72
- <h3 class="section-header">Methods</h3>
73
-
74
- <ul class="link-list">
75
-
76
- <li ><a href="#method-c-new">::new</a>
77
-
78
- <li ><a href="#method-i-find_by_url">#find_by_url</a>
79
-
80
- <li ><a href="#method-i-get_token_from">#get_token_from</a>
81
-
82
- <li ><a href="#method-i-groups">#groups</a>
83
-
84
- <li ><a href="#method-i-http_get">#http_get</a>
85
-
86
- <li ><a href="#method-i-licenses">#licenses</a>
87
-
88
- <li ><a href="#method-i-login_url">#login_url</a>
89
-
90
- <li ><a href="#method-i-method_missing">#method_missing</a>
91
-
92
- <li ><a href="#method-i-photos">#photos</a>
93
-
94
- <li ><a href="#method-i-photos_request">#photos_request</a>
95
-
96
- <li ><a href="#method-i-photos_search">#photos_search</a>
97
-
98
- <li ><a href="#method-i-photoset">#photoset</a>
99
-
100
- <li ><a href="#method-i-recent">#recent</a>
101
-
102
- <li ><a href="#method-i-related_tags">#related_tags</a>
103
-
104
- <li ><a href="#method-i-request">#request</a>
105
-
106
- <li ><a href="#method-i-request_url">#request_url</a>
107
-
108
- <li ><a href="#method-i-search">#search</a>
109
-
110
- <li ><a href="#method-i-set_up_configuration">#set_up_configuration</a>
111
-
112
- <li ><a href="#method-i-signature_from">#signature_from</a>
113
-
114
- <li ><a href="#method-i-tag">#tag</a>
115
-
116
- <li ><a href="#method-i-users">#users</a>
117
-
118
- </ul>
119
- </nav>
120
-
121
- </div>
122
-
123
- <div id="project-metadata">
124
- <nav id="fileindex-section" class="section project-section">
125
- <h3 class="section-header">Pages</h3>
126
-
127
- <ul>
128
-
129
- <li class="file"><a href="./README_md.html">README</a>
130
-
131
- </ul>
132
- </nav>
133
-
134
- <nav id="classindex-section" class="section project-section">
135
- <h3 class="section-header">Class and Module Index</h3>
136
-
137
- <ul class="link-list">
138
-
139
- <li><a href="./Flickr.html">Flickr</a>
140
-
141
- <li><a href="./Flickr/Config.html">Flickr::Config</a>
142
-
143
- <li><a href="./Flickr/Group.html">Flickr::Group</a>
144
-
145
- <li><a href="./Flickr/Photo.html">Flickr::Photo</a>
146
-
147
- <li><a href="./Flickr/PhotoCollection.html">Flickr::PhotoCollection</a>
148
-
149
- <li><a href="./Flickr/Photoset.html">Flickr::Photoset</a>
150
-
151
- <li><a href="./Flickr/User.html">Flickr::User</a>
152
-
153
- </ul>
154
- </nav>
155
-
156
- </div>
157
- </nav>
158
-
159
- <div id="documentation">
160
- <h1 class="class">class Flickr</h1>
161
-
162
- <div id="description" class="description">
163
-
164
- <p><a href="Flickr.html">Flickr</a> client class. Requires an API key</p>
165
-
166
- </div><!-- description -->
167
-
168
-
169
-
170
-
171
- <section id="5Buntitled-5D" class="documentation-section">
172
-
173
-
174
-
175
-
176
-
177
- <!-- Constants -->
178
- <section id="constants-list" class="section">
179
- <h3 class="section-header">Constants</h3>
180
- <dl>
181
-
182
- <dt id="API_PATH">API_PATH
183
-
184
- <dd class="description">
185
-
186
-
187
- <dt id="HOST_URL">HOST_URL
188
-
189
- <dd class="description">
190
-
191
-
192
- <dt id="VALID_SIZES">VALID_SIZES
193
-
194
- <dd class="description"><p><a href="Flickr.html">Flickr</a>, annoyingly, uses a number of
195
- representations to specify the size of a photo, depending on the context.
196
- It gives a label such a “Small” or “Medium” to a size of photo, when
197
- returning all possible sizes. However, when generating the uri for the page
198
- that features that size of photo, or the source url for the image itself it
199
- uses a single letter. Bizarrely, these letters are different depending on
200
- whether you want the <a href="Flickr.html">Flickr</a> page for the photo or
201
- the source uri – e.g. a “Small” photo (240 pixels on its longest side) may
202
- be viewed at “<a
203
- href="http://www.flickr.com/photos/sco/2397458775/sizes/s">www.flickr.com/photos/sco/2397458775/sizes/s</a>/”
204
- but its source is at “<img
205
- src="http://farm4.static.flickr.com/3118/2397458775_2ec2ddc324_m.jpg" />”.
206
- The <a href="Flickr.html#VALID_SIZES">VALID_SIZES</a> hash associates the
207
- correct letter with a label</p>
208
-
209
-
210
- </dl>
211
- </section>
212
-
213
-
214
-
215
- <!-- Attributes -->
216
- <section id="attribute-method-details" class="method-section section">
217
- <h3 class="section-header">Attributes</h3>
218
-
219
-
220
- <div id="attribute-i-api_key" class="method-detail">
221
- <div class="method-heading attribute-method-heading">
222
- <span class="method-name">api_key</span><span
223
- class="attribute-access-type">[R]</span>
224
- </div>
225
-
226
- <div class="method-description">
227
-
228
-
229
-
230
- </div>
231
- </div>
232
-
233
- <div id="attribute-i-auth_token" class="method-detail">
234
- <div class="method-heading attribute-method-heading">
235
- <span class="method-name">auth_token</span><span
236
- class="attribute-access-type">[R]</span>
237
- </div>
238
-
239
- <div class="method-description">
240
-
241
-
242
-
243
- </div>
244
- </div>
245
-
246
- <div id="attribute-i-user" class="method-detail">
247
- <div class="method-heading attribute-method-heading">
248
- <span class="method-name">user</span><span
249
- class="attribute-access-type">[RW]</span>
250
- </div>
251
-
252
- <div class="method-description">
253
-
254
-
255
-
256
- </div>
257
- </div>
258
-
259
- </section><!-- attribute-method-details -->
260
-
261
-
262
- <!-- Methods -->
263
-
264
- <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
265
- <h3 class="section-header">Public Class Methods</h3>
266
-
267
-
268
- <div id="method-c-new" class="method-detail ">
269
-
270
- <div class="method-heading">
271
- <span class="method-name">new</span><span
272
- class="method-args">(api_key_or_params={})</span>
273
-
274
- <span class="method-click-advice">click to toggle source</span>
275
-
276
- </div>
277
-
278
-
279
- <div class="method-description">
280
-
281
- <p>To use the <a href="Flickr.html">Flickr</a> API you need an api key (see <a
282
- href="http://www.flickr.com/services/api/misc.api_keys.html">www.flickr.com/services/api/misc.api_keys.html</a>),
283
- and the flickr client object shuld be initialized with this. You&#39;ll
284
- also need a shared secret code if you want to use authentication (e.g. to
285
- get a user&#39;s private photos) There are two ways to initialize the <a
286
- href="Flickr.html">Flickr</a> client. The preferred way is with a hash of
287
- params, e.g. &#39;api_key&#39; =&gt; &#39;your_api_key&#39;,
288
- &#39;shared_secret&#39; =&gt; &#39;shared_secret_code&#39;,
289
- &#39;verify_ssl&#39; =&gt; true, &#39;ca_file&#39; =&gt;
290
- &#39;/path/to/cert.pem&#39;. Other way is to use in Rails an config file
291
- RAILS_ROOT/config/flickr.api.yml and there use params as key/values even
292
- specified for every environment.</p>
293
-
294
-
295
-
296
-
297
- <div class="method-source-code" id="new-source">
298
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 81</span>
299
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">api_key_or_params</span>={})
300
- <span class="ruby-ivar">@host</span> = <span class="ruby-constant">HOST_URL</span>
301
- <span class="ruby-ivar">@api</span> = <span class="ruby-constant">API_PATH</span>
302
- <span class="ruby-ivar">@verify_ssl</span> = <span class="ruby-keyword">true</span>
303
- <span class="ruby-identifier">api_key_or_params</span>={} <span class="ruby-keyword">if</span> <span class="ruby-identifier">api_key_or_params</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-comment"># fix for nil value as argument</span>
304
- <span class="ruby-identifier">api_key_or_params</span> = {<span class="ruby-value">:api_key</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">api_key_or_params</span>} <span class="ruby-keyword">if</span> <span class="ruby-identifier">api_key_or_params</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
305
- <span class="ruby-identifier">api_key_or_params</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">get</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">parsed?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">api_key_or_params</span>.<span class="ruby-identifier">empty?</span>
306
- <span class="ruby-identifier">set_up_configuration</span> <span class="ruby-identifier">api_key_or_params</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">api_key_or_params</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
307
- <span class="ruby-keyword">end</span></pre>
308
- </div><!-- new-source -->
309
-
310
- </div>
311
-
312
-
313
-
314
-
315
- </div><!-- new-method -->
316
-
317
-
318
- </section><!-- public-class-method-details -->
319
-
320
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
321
- <h3 class="section-header">Public Instance Methods</h3>
322
-
323
-
324
- <div id="method-i-find_by_url" class="method-detail ">
325
-
326
- <div class="method-heading">
327
- <span class="method-name">find_by_url</span><span
328
- class="method-args">(url)</span>
329
-
330
- <span class="method-click-advice">click to toggle source</span>
331
-
332
- </div>
333
-
334
-
335
- <div class="method-description">
336
-
337
- <p>Implements flickr.urls.lookupGroup and flickr.urls.lookupUser</p>
338
-
339
-
340
-
341
-
342
- <div class="method-source-code" id="find_by_url-source">
343
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 113</span>
344
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">find_by_url</span>(<span class="ruby-identifier">url</span>)
345
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">urls_lookupUser</span>(<span class="ruby-string">&#39;url&#39;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">url</span>) <span class="ruby-keyword">rescue</span> <span class="ruby-identifier">urls_lookupGroup</span>(<span class="ruby-string">&#39;url&#39;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">url</span>) <span class="ruby-keyword">rescue</span> <span class="ruby-keyword">nil</span>
346
- (<span class="ruby-identifier">response</span>[<span class="ruby-string">&#39;user&#39;</span>]) <span class="ruby-operator">?</span> <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>[<span class="ruby-string">&#39;user&#39;</span>][<span class="ruby-string">&#39;id&#39;</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-ivar">@api_key</span>) <span class="ruby-operator">:</span> <span class="ruby-constant">Group</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>[<span class="ruby-string">&#39;group&#39;</span>][<span class="ruby-string">&#39;id&#39;</span>], <span class="ruby-ivar">@api_key</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">nil?</span>
347
- <span class="ruby-keyword">end</span></pre>
348
- </div><!-- find_by_url-source -->
349
-
350
- </div>
351
-
352
-
353
-
354
-
355
- </div><!-- find_by_url-method -->
356
-
357
-
358
- <div id="method-i-get_token_from" class="method-detail ">
359
-
360
- <div class="method-heading">
361
- <span class="method-name">get_token_from</span><span
362
- class="method-args">(frob)</span>
363
-
364
- <span class="method-click-advice">click to toggle source</span>
365
-
366
- </div>
367
-
368
-
369
- <div class="method-description">
370
-
371
- <p>Gets authentication token given a <a href="Flickr.html">Flickr</a> frob,
372
- which is returned when user allows access to their account for the
373
- application with the <a href="Flickr.html#attribute-i-api_key">#api_key</a>
374
- which made the request</p>
375
-
376
-
377
-
378
-
379
- <div class="method-source-code" id="get_token_from-source">
380
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 102</span>
381
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">get_token_from</span>(<span class="ruby-identifier">frob</span>)
382
- <span class="ruby-identifier">auth_response</span> = <span class="ruby-identifier">request</span>(<span class="ruby-string">&quot;auth.getToken&quot;</span>, <span class="ruby-value">:frob</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">frob</span>)[<span class="ruby-string">&#39;auth&#39;</span>]
383
- <span class="ruby-ivar">@auth_token</span> = <span class="ruby-identifier">auth_response</span>[<span class="ruby-string">&#39;token&#39;</span>]
384
- <span class="ruby-ivar">@user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&#39;id&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">auth_response</span>[<span class="ruby-string">&#39;user&#39;</span>][<span class="ruby-string">&#39;nsid&#39;</span>],
385
- <span class="ruby-string">&#39;username&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">auth_response</span>[<span class="ruby-string">&#39;user&#39;</span>][<span class="ruby-string">&#39;username&#39;</span>],
386
- <span class="ruby-string">&#39;name&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">auth_response</span>[<span class="ruby-string">&#39;user&#39;</span>][<span class="ruby-string">&#39;fullname&#39;</span>],
387
- <span class="ruby-string">&#39;client&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">self</span>)
388
- <span class="ruby-ivar">@auth_token</span>
389
- <span class="ruby-keyword">end</span></pre>
390
- </div><!-- get_token_from-source -->
391
-
392
- </div>
393
-
394
-
395
-
396
-
397
- </div><!-- get_token_from-method -->
398
-
399
-
400
- <div id="method-i-groups" class="method-detail ">
401
-
402
- <div class="method-heading">
403
- <span class="method-name">groups</span><span
404
- class="method-args">(group_name, options={})</span>
405
-
406
- <span class="method-click-advice">click to toggle source</span>
407
-
408
- </div>
409
-
410
-
411
- <div class="method-description">
412
-
413
- <p>Implements flickr.groups.search</p>
414
-
415
-
416
-
417
-
418
- <div class="method-source-code" id="groups-source">
419
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 146</span>
420
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">groups</span>(<span class="ruby-identifier">group_name</span>, <span class="ruby-identifier">options</span>={})
421
- <span class="ruby-identifier">collection</span> = <span class="ruby-identifier">groups_search</span>({<span class="ruby-string">&quot;text&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">group_name</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>))[<span class="ruby-string">&#39;groups&#39;</span>][<span class="ruby-string">&#39;group&#39;</span>]
422
- <span class="ruby-identifier">collection</span> = [<span class="ruby-identifier">collection</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">collection</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
423
-
424
- <span class="ruby-identifier">collection</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">group</span><span class="ruby-operator">|</span> <span class="ruby-constant">Group</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">group</span>[<span class="ruby-string">&#39;nsid&#39;</span>],
425
- <span class="ruby-string">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">group</span>[<span class="ruby-string">&#39;name&#39;</span>],
426
- <span class="ruby-string">&quot;eighteenplus&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">group</span>[<span class="ruby-string">&#39;eighteenplus&#39;</span>],
427
- <span class="ruby-string">&quot;client&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">self</span>) }
428
- <span class="ruby-keyword">end</span></pre>
429
- </div><!-- groups-source -->
430
-
431
- </div>
432
-
433
-
434
-
435
-
436
- </div><!-- groups-method -->
437
-
438
-
439
- <div id="method-i-http_get" class="method-detail ">
440
-
441
- <div class="method-heading">
442
- <span class="method-name">http_get</span><span
443
- class="method-args">(url)</span>
444
-
445
- <span class="method-click-advice">click to toggle source</span>
446
-
447
- </div>
448
-
449
-
450
- <div class="method-description">
451
-
452
- <p>Does an HTTP GET on a given URL and returns the response body</p>
453
-
454
-
455
-
456
-
457
- <div class="method-source-code" id="http_get-source">
458
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 184</span>
459
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">http_get</span>(<span class="ruby-identifier">url</span>)
460
- <span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>)
461
- <span class="ruby-identifier">http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">url</span>.<span class="ruby-identifier">port</span>
462
- <span class="ruby-identifier">http</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword">true</span>
463
- <span class="ruby-identifier">http</span>.<span class="ruby-identifier">verify_mode</span> = (<span class="ruby-ivar">@verify_ssl</span> <span class="ruby-operator">?</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_PEER</span> <span class="ruby-operator">:</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_NONE</span>)
464
- <span class="ruby-identifier">http</span>.<span class="ruby-identifier">ca_file</span> = <span class="ruby-ivar">@ca_file</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ca_file</span>
465
- <span class="ruby-identifier">http</span>.<span class="ruby-identifier">start</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">res</span><span class="ruby-operator">|</span>
466
- <span class="ruby-identifier">res</span>.<span class="ruby-identifier">request_get</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">body</span>.<span class="ruby-identifier">to_s</span>
467
- <span class="ruby-keyword">end</span>
468
- <span class="ruby-keyword">end</span></pre>
469
- </div><!-- http_get-source -->
470
-
471
- </div>
472
-
473
-
474
-
475
-
476
- </div><!-- http_get-method -->
477
-
478
-
479
- <div id="method-i-licenses" class="method-detail ">
480
-
481
- <div class="method-heading">
482
- <span class="method-name">licenses</span><span
483
- class="method-args">()</span>
484
-
485
- <span class="method-click-advice">click to toggle source</span>
486
-
487
- </div>
488
-
489
-
490
- <div class="method-description">
491
-
492
- <p>Implements flickr.photos.licenses.getInfo</p>
493
-
494
-
495
-
496
-
497
- <div class="method-source-code" id="licenses-source">
498
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 166</span>
499
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">licenses</span>
500
- <span class="ruby-identifier">photos_licenses_getInfo</span>[<span class="ruby-string">&#39;licenses&#39;</span>][<span class="ruby-string">&#39;license&#39;</span>]
501
- <span class="ruby-keyword">end</span></pre>
502
- </div><!-- licenses-source -->
503
-
504
- </div>
505
-
506
-
507
-
508
-
509
- </div><!-- licenses-method -->
510
-
511
-
512
- <div id="method-i-login_url" class="method-detail ">
513
-
514
- <div class="method-heading">
515
- <span class="method-name">login_url</span><span
516
- class="method-args">(perms)</span>
517
-
518
- <span class="method-click-advice">click to toggle source</span>
519
-
520
- </div>
521
-
522
-
523
- <div class="method-description">
524
-
525
- <p>Returns url for user to login in to <a href="Flickr.html">Flickr</a> to
526
- authenticate app for a user</p>
527
-
528
-
529
-
530
-
531
- <div class="method-source-code" id="login_url-source">
532
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 171</span>
533
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">login_url</span>(<span class="ruby-identifier">perms</span>)
534
- <span class="ruby-node">&quot;https://flickr.com/services/auth/?api_key=#{@api_key}&amp;perms=#{perms}&amp;api_sig=#{signature_from(&#39;api_key&#39;=&gt;@api_key, &#39;perms&#39; =&gt; perms)}&quot;</span>
535
- <span class="ruby-keyword">end</span></pre>
536
- </div><!-- login_url-source -->
537
-
538
- </div>
539
-
540
-
541
-
542
-
543
- </div><!-- login_url-method -->
544
-
545
-
546
- <div id="method-i-method_missing" class="method-detail ">
547
-
548
- <div class="method-heading">
549
- <span class="method-name">method_missing</span><span
550
- class="method-args">(method_id, params={})</span>
551
-
552
- <span class="method-click-advice">click to toggle source</span>
553
-
554
- </div>
555
-
556
-
557
- <div class="method-description">
558
-
559
- <p>Implements everything else. Any method not defined explicitly will be
560
- passed on to the <a href="Flickr.html">Flickr</a> API, and return an
561
- XmlSimple document. For example, Flickr#test_echo is not defined, so it
562
- will pass the call to the flickr.test.echo method.</p>
563
-
564
-
565
-
566
-
567
- <div class="method-source-code" id="method_missing-source">
568
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 179</span>
569
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method_id</span>, <span class="ruby-identifier">params</span>={})
570
- <span class="ruby-identifier">request</span>(<span class="ruby-identifier">method_id</span>.<span class="ruby-identifier">id2name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/_/</span>, <span class="ruby-string">&#39;.&#39;</span>), <span class="ruby-identifier">params</span>)
571
- <span class="ruby-keyword">end</span></pre>
572
- </div><!-- method_missing-source -->
573
-
574
- </div>
575
-
576
-
577
-
578
-
579
- </div><!-- method_missing-method -->
580
-
581
-
582
- <div id="method-i-photos" class="method-detail ">
583
-
584
- <div class="method-heading">
585
- <span class="method-name">photos</span><span
586
- class="method-args">(*criteria)</span>
587
-
588
- <span class="method-click-advice">click to toggle source</span>
589
-
590
- </div>
591
-
592
-
593
- <div class="method-description">
594
-
595
- <p>Implements flickr.photos.getRecent and flickr.photos.search</p>
596
-
597
-
598
-
599
-
600
- <div class="method-source-code" id="photos-source">
601
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 119</span>
602
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">photos</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">criteria</span>)
603
- <span class="ruby-keyword">not</span> <span class="ruby-identifier">criteria</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">photos_search</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">criteria</span>) <span class="ruby-keyword">or</span> <span class="ruby-identifier">recent</span>
604
- <span class="ruby-keyword">end</span></pre>
605
- </div><!-- photos-source -->
606
-
607
- </div>
608
-
609
-
610
-
611
-
612
- </div><!-- photos-method -->
613
-
614
-
615
- <div id="method-i-photos_request" class="method-detail ">
616
-
617
- <div class="method-heading">
618
- <span class="method-name">photos_request</span><span
619
- class="method-args">(method, params={}, list_node="photos")</span>
620
-
621
- <span class="method-click-advice">click to toggle source</span>
622
-
623
- </div>
624
-
625
-
626
- <div class="method-description">
627
-
628
- <p>acts like request but returns a <a
629
- href="Flickr/PhotoCollection.html">PhotoCollection</a> (a list of <a
630
- href="Flickr/Photo.html">Photo</a> objects)</p>
631
-
632
-
633
-
634
-
635
- <div class="method-source-code" id="photos_request-source">
636
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 204</span>
637
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">photos_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span>={}, <span class="ruby-identifier">list_node</span>=<span class="ruby-string">&quot;photos&quot;</span>)
638
- <span class="ruby-identifier">photos</span> = <span class="ruby-identifier">request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span>)
639
- <span class="ruby-constant">PhotoCollection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">photos</span>, <span class="ruby-ivar">@api_key</span>, <span class="ruby-identifier">list_node</span>)
640
- <span class="ruby-keyword">end</span></pre>
641
- </div><!-- photos_request-source -->
642
-
643
- </div>
644
-
645
-
646
-
647
-
648
- </div><!-- photos_request-method -->
649
-
650
-
651
- <div id="method-i-photos_search" class="method-detail ">
652
-
653
- <div class="method-heading">
654
- <span class="method-name">photos_search</span><span
655
- class="method-args">(params={})</span>
656
-
657
- <span class="method-click-advice">click to toggle source</span>
658
-
659
- </div>
660
-
661
-
662
- <div class="method-description">
663
-
664
-
665
-
666
-
667
-
668
-
669
- <div class="method-source-code" id="photos_search-source">
670
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 129</span>
671
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">photos_search</span>(<span class="ruby-identifier">params</span>={})
672
- <span class="ruby-identifier">photos_request</span>(<span class="ruby-string">&#39;photos.search&#39;</span>, <span class="ruby-identifier">params</span>)
673
- <span class="ruby-keyword">end</span></pre>
674
- </div><!-- photos_search-source -->
675
-
676
- </div>
677
-
678
-
679
- <div class="aliases">
680
- Also aliased as: <a href="Flickr.html#method-i-search">search</a>
681
- </div>
682
-
683
-
684
-
685
- </div><!-- photos_search-method -->
686
-
687
-
688
- <div id="method-i-photoset" class="method-detail ">
689
-
690
- <div class="method-heading">
691
- <span class="method-name">photoset</span><span
692
- class="method-args">(photoset_id)</span>
693
-
694
- <span class="method-click-advice">click to toggle source</span>
695
-
696
- </div>
697
-
698
-
699
- <div class="method-description">
700
-
701
-
702
-
703
-
704
-
705
-
706
- <div class="method-source-code" id="photoset-source">
707
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 156</span>
708
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">photoset</span>(<span class="ruby-identifier">photoset_id</span>)
709
- <span class="ruby-constant">Photoset</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">photoset_id</span>, <span class="ruby-ivar">@api_key</span>)
710
- <span class="ruby-keyword">end</span></pre>
711
- </div><!-- photoset-source -->
712
-
713
- </div>
714
-
715
-
716
-
717
-
718
- </div><!-- photoset-method -->
719
-
720
-
721
- <div id="method-i-recent" class="method-detail ">
722
-
723
- <div class="method-heading">
724
- <span class="method-name">recent</span><span
725
- class="method-args">()</span>
726
-
727
- <span class="method-click-advice">click to toggle source</span>
728
-
729
- </div>
730
-
731
-
732
- <div class="method-description">
733
-
734
- <p>flickr.photos.getRecent 100 newest photos from everyone</p>
735
-
736
-
737
-
738
-
739
- <div class="method-source-code" id="recent-source">
740
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 125</span>
741
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">recent</span>
742
- <span class="ruby-identifier">photos_request</span>(<span class="ruby-string">&#39;photos.getRecent&#39;</span>)
743
- <span class="ruby-keyword">end</span></pre>
744
- </div><!-- recent-source -->
745
-
746
- </div>
747
-
748
-
749
-
750
-
751
- </div><!-- recent-method -->
752
-
753
-
754
- <div id="method-i-related_tags" class="method-detail ">
755
-
756
- <div class="method-heading">
757
- <span class="method-name">related_tags</span><span
758
- class="method-args">(tag)</span>
759
-
760
- <span class="method-click-advice">click to toggle source</span>
761
-
762
- </div>
763
-
764
-
765
- <div class="method-description">
766
-
767
- <p>Implements flickr.tags.getRelated</p>
768
-
769
-
770
-
771
-
772
- <div class="method-source-code" id="related_tags-source">
773
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 161</span>
774
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">related_tags</span>(<span class="ruby-identifier">tag</span>)
775
- <span class="ruby-identifier">tags_getRelated</span>(<span class="ruby-string">&#39;tag&#39;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">tag</span>)[<span class="ruby-string">&#39;tags&#39;</span>][<span class="ruby-string">&#39;tag&#39;</span>]
776
- <span class="ruby-keyword">end</span></pre>
777
- </div><!-- related_tags-source -->
778
-
779
- </div>
780
-
781
-
782
-
783
-
784
- </div><!-- related_tags-method -->
785
-
786
-
787
- <div id="method-i-request" class="method-detail ">
788
-
789
- <div class="method-heading">
790
- <span class="method-name">request</span><span
791
- class="method-args">(method, params={})</span>
792
-
793
- <span class="method-click-advice">click to toggle source</span>
794
-
795
- </div>
796
-
797
-
798
- <div class="method-description">
799
-
800
- <p>Takes a <a href="Flickr.html">Flickr</a> API method name and set of
801
- parameters; returns an XmlSimple object with the response</p>
802
-
803
-
804
-
805
-
806
- <div class="method-source-code" id="request-source">
807
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 196</span>
808
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span>={})
809
- <span class="ruby-identifier">url</span> = <span class="ruby-identifier">request_url</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span>)
810
- <span class="ruby-identifier">response</span> = <span class="ruby-constant">XmlSimple</span>.<span class="ruby-identifier">xml_in</span>(<span class="ruby-identifier">http_get</span>(<span class="ruby-identifier">url</span>), { <span class="ruby-string">&#39;ForceArray&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span> })
811
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">response</span>[<span class="ruby-string">&#39;err&#39;</span>][<span class="ruby-string">&#39;msg&#39;</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span>[<span class="ruby-string">&#39;stat&#39;</span>] <span class="ruby-operator">!=</span> <span class="ruby-string">&#39;ok&#39;</span>
812
- <span class="ruby-identifier">response</span>
813
- <span class="ruby-keyword">end</span></pre>
814
- </div><!-- request-source -->
815
-
816
- </div>
817
-
818
-
819
-
820
-
821
- </div><!-- request-method -->
822
-
823
-
824
- <div id="method-i-request_url" class="method-detail ">
825
-
826
- <div class="method-heading">
827
- <span class="method-name">request_url</span><span
828
- class="method-args">(method, params={})</span>
829
-
830
- <span class="method-click-advice">click to toggle source</span>
831
-
832
- </div>
833
-
834
-
835
- <div class="method-description">
836
-
837
- <p>Builds url for <a href="Flickr.html">Flickr</a> API REST request from given
838
- the flickr method name (exclusing the &#39;flickr.&#39; that begins each
839
- method call) and params (where applicable) which should be supplied as a
840
- Hash (e.g &#39;user_id&#39; =&gt; “foo123”)</p>
841
-
842
-
843
-
844
-
845
- <div class="method-source-code" id="request_url-source">
846
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 212</span>
847
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">request_url</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">params</span>={})
848
- <span class="ruby-identifier">method</span> = <span class="ruby-string">&#39;flickr.&#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">method</span>
849
- <span class="ruby-identifier">url</span> = <span class="ruby-node">&quot;#{@host}#{@api}/?api_key=#{@api_key}&amp;method=#{method}&quot;</span>
850
- <span class="ruby-identifier">params</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-string">&#39;api_key&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@api_key</span>, <span class="ruby-string">&#39;method&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">method</span>, <span class="ruby-string">&#39;auth_token&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@auth_token</span>)
851
- <span class="ruby-identifier">signature</span> = <span class="ruby-identifier">signature_from</span>(<span class="ruby-identifier">params</span>)
852
-
853
- <span class="ruby-identifier">url</span> = <span class="ruby-node">&quot;#{@host}#{@api}/?&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-string">&#39;api_sig&#39;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">signature</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;#{k}=&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">CGI</span><span class="ruby-operator">::</span><span class="ruby-identifier">escape</span>(<span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">nil?</span> }.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;&amp;&quot;</span>)
854
- <span class="ruby-keyword">end</span></pre>
855
- </div><!-- request_url-source -->
856
-
857
- </div>
858
-
859
-
860
-
861
-
862
- </div><!-- request_url-method -->
863
-
864
-
865
- <div id="method-i-search" class="method-detail method-alias">
866
-
867
- <div class="method-heading">
868
- <span class="method-name">search</span><span
869
- class="method-args">(params={})</span>
870
-
871
- </div>
872
-
873
-
874
- <div class="method-description">
875
-
876
-
877
-
878
-
879
-
880
-
881
- </div>
882
-
883
-
884
-
885
-
886
- <div class="aliases">
887
- Alias for: <a href="Flickr.html#method-i-photos_search">photos_search</a>
888
- </div>
889
-
890
- </div><!-- search-method -->
891
-
892
-
893
- <div id="method-i-set_up_configuration" class="method-detail ">
894
-
895
- <div class="method-heading">
896
- <span class="method-name">set_up_configuration</span><span
897
- class="method-args">(api_key_or_params = {})</span>
898
-
899
- <span class="method-click-advice">click to toggle source</span>
900
-
901
- </div>
902
-
903
-
904
- <div class="method-description">
905
-
906
-
907
-
908
-
909
-
910
-
911
- <div class="method-source-code" id="set_up_configuration-source">
912
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 91</span>
913
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">set_up_configuration</span> <span class="ruby-identifier">api_key_or_params</span> = {}
914
- <span class="ruby-ivar">@api_key</span> = <span class="ruby-identifier">api_key_or_params</span>[<span class="ruby-value">:api_key</span>]
915
- <span class="ruby-ivar">@shared_secret</span> = <span class="ruby-identifier">api_key_or_params</span>[<span class="ruby-value">:shared_secret</span>]
916
- <span class="ruby-ivar">@auth_token</span> = <span class="ruby-identifier">api_key_or_params</span>[<span class="ruby-value">:auth_token</span>]
917
- <span class="ruby-ivar">@ca_file</span> = <span class="ruby-identifier">api_key_or_params</span>[<span class="ruby-value">:ca_file</span>]
918
- <span class="ruby-ivar">@verify_ssl</span> = <span class="ruby-operator">!</span>(<span class="ruby-identifier">api_key_or_params</span>[<span class="ruby-value">:verify_ssl</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-operator">===</span> <span class="ruby-string">&#39;false&#39;</span>)
919
- <span class="ruby-keyword">end</span></pre>
920
- </div><!-- set_up_configuration-source -->
921
-
922
- </div>
923
-
924
-
925
-
926
-
927
- </div><!-- set_up_configuration-method -->
928
-
929
-
930
- <div id="method-i-signature_from" class="method-detail ">
931
-
932
- <div class="method-heading">
933
- <span class="method-name">signature_from</span><span
934
- class="method-args">(params={})</span>
935
-
936
- <span class="method-click-advice">click to toggle source</span>
937
-
938
- </div>
939
-
940
-
941
- <div class="method-description">
942
-
943
-
944
-
945
-
946
-
947
-
948
- <div class="method-source-code" id="signature_from-source">
949
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 221</span>
950
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">signature_from</span>(<span class="ruby-identifier">params</span>={})
951
- <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@shared_secret</span> <span class="ruby-comment"># don&#39;t both getting signature if no shared_secret</span>
952
- <span class="ruby-identifier">request_str</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">nil?</span>}.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;#{p[0].to_s}#{p[1]}&quot;</span>}.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">join</span> <span class="ruby-comment"># build key value pairs, sort in alpha order then join them, ignoring those with nil value</span>
953
- <span class="ruby-keyword">return</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-node">&quot;#{@shared_secret}#{request_str}&quot;</span>)
954
- <span class="ruby-keyword">end</span></pre>
955
- </div><!-- signature_from-source -->
956
-
957
- </div>
958
-
959
-
960
-
961
-
962
- </div><!-- signature_from-method -->
963
-
964
-
965
- <div id="method-i-tag" class="method-detail ">
966
-
967
- <div class="method-heading">
968
- <span class="method-name">tag</span><span
969
- class="method-args">(tag)</span>
970
-
971
- <span class="method-click-advice">click to toggle source</span>
972
-
973
- </div>
974
-
975
-
976
- <div class="method-description">
977
-
978
- <p>Gets public photos with a given tag</p>
979
-
980
-
981
-
982
-
983
- <div class="method-source-code" id="tag-source">
984
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 135</span>
985
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">tag</span>(<span class="ruby-identifier">tag</span>)
986
- <span class="ruby-identifier">photos</span>(<span class="ruby-string">&#39;tags&#39;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">tag</span>)
987
- <span class="ruby-keyword">end</span></pre>
988
- </div><!-- tag-source -->
989
-
990
- </div>
991
-
992
-
993
-
994
-
995
- </div><!-- tag-method -->
996
-
997
-
998
- <div id="method-i-users" class="method-detail ">
999
-
1000
- <div class="method-heading">
1001
- <span class="method-name">users</span><span
1002
- class="method-args">(lookup=nil)</span>
1003
-
1004
- <span class="method-click-advice">click to toggle source</span>
1005
-
1006
- </div>
1007
-
1008
-
1009
- <div class="method-description">
1010
-
1011
- <p>Implements flickr.people.findByEmail and flickr.people.findByUsername.</p>
1012
-
1013
-
1014
-
1015
-
1016
- <div class="method-source-code" id="users-source">
1017
- <pre><span class="ruby-comment"># File lib/flickr.rb, line 140</span>
1018
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">users</span>(<span class="ruby-identifier">lookup</span>=<span class="ruby-keyword">nil</span>)
1019
- <span class="ruby-identifier">user</span> = <span class="ruby-identifier">people_findByEmail</span>(<span class="ruby-string">&#39;find_email&#39;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">lookup</span>)[<span class="ruby-string">&#39;user&#39;</span>] <span class="ruby-keyword">rescue</span> <span class="ruby-identifier">people_findByUsername</span>(<span class="ruby-string">&#39;username&#39;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">lookup</span>)[<span class="ruby-string">&#39;user&#39;</span>]
1020
- <span class="ruby-keyword">return</span> <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;id&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">user</span>[<span class="ruby-string">&quot;nsid&quot;</span>], <span class="ruby-string">&quot;username&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">user</span>[<span class="ruby-string">&quot;username&quot;</span>], <span class="ruby-string">&quot;client&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">self</span>)
1021
- <span class="ruby-keyword">end</span></pre>
1022
- </div><!-- users-source -->
1023
-
1024
- </div>
1025
-
1026
-
1027
-
1028
-
1029
- </div><!-- users-method -->
1030
-
1031
-
1032
- </section><!-- public-instance-method-details -->
1033
-
1034
- </section><!-- 5Buntitled-5D -->
1035
-
1036
- </div><!-- documentation -->
1037
-
1038
-
1039
- <footer id="validator-badges">
1040
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
1041
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
1042
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
1043
- </footer>
1044
-