flickrie 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile +7 -6
- data/README.md +18 -1
- data/Rakefile +47 -9
- data/flickrie.gemspec +19 -15
- data/lib/flickrie/api_methods.rb +23 -0
- data/lib/flickrie/client.rb +16 -11
- data/lib/flickrie/instance.rb +7 -0
- data/lib/flickrie/media/exif.rb +12 -3
- data/lib/flickrie/media/note.rb +5 -0
- data/lib/flickrie/media/tag.rb +4 -3
- data/lib/flickrie/media/visibility.rb +4 -3
- data/lib/flickrie/media.rb +19 -0
- data/lib/flickrie/oauth.rb +5 -7
- data/lib/flickrie/photo.rb +6 -2
- data/lib/flickrie/set.rb +10 -0
- data/lib/flickrie/upload_client.rb +10 -12
- data/lib/flickrie/user.rb +4 -0
- data/lib/flickrie/version.rb +1 -1
- data/lib/flickrie/video.rb +4 -0
- data/spec/api_methods_spec.rb +2 -0
- data/spec/error_spec.rb +2 -0
- data/spec/fixtures/vcr_cassettes/api_methods/asynchronous_upload.yml +397 -0
- data/spec/fixtures/vcr_cassettes/api_methods/replace.yml +126 -0
- data/spec/fixtures/vcr_cassettes/api_methods/tags.yml +178 -0
- data/spec/fixtures/vcr_cassettes/api_methods/upload_and_delete.yml +152 -0
- data/spec/fixtures/vcr_cassettes/error/code.yml +84 -0
- data/spec/fixtures/vcr_cassettes/error/was_raised.yml +84 -0
- data/spec/fixtures/vcr_cassettes/instance/calling_api_methods.yml +231 -0
- data/spec/fixtures/vcr_cassettes/license/get.yml +38 -0
- data/spec/fixtures/vcr_cassettes/media/from_contacts.yml +73 -0
- data/spec/fixtures/vcr_cassettes/media/from_set.yml +38 -0
- data/spec/fixtures/vcr_cassettes/media/get_context.yml +38 -0
- data/spec/fixtures/vcr_cassettes/media/get_exif.yml +73 -0
- data/spec/fixtures/vcr_cassettes/media/get_info.yml +108 -0
- data/spec/fixtures/vcr_cassettes/media/public_from_user.yml +38 -0
- data/spec/fixtures/vcr_cassettes/media/search.yml +38 -0
- data/spec/fixtures/vcr_cassettes/media_count/get.yml +73 -0
- data/spec/fixtures/vcr_cassettes/oauth/incorrect_credentials.yml +167 -0
- data/spec/fixtures/vcr_cassettes/photo/get_info.yml +38 -0
- data/spec/fixtures/vcr_cassettes/photo/get_sizes.yml +73 -0
- data/spec/fixtures/vcr_cassettes/photo/search.yml +38 -0
- data/spec/fixtures/vcr_cassettes/set/from_user.yml +143 -0
- data/spec/fixtures/vcr_cassettes/set/get_info.yml +283 -0
- data/spec/fixtures/vcr_cassettes/user/find_by_username_or_email.yml +73 -0
- data/spec/fixtures/vcr_cassettes/user/get_info.yml +73 -0
- data/spec/fixtures/vcr_cassettes/video/get_info.yml +38 -0
- data/spec/fixtures/vcr_cassettes/video/get_sizes.yml +73 -0
- data/spec/instance_spec.rb +2 -0
- data/spec/license_spec.rb +2 -0
- data/spec/location_spec.rb +2 -0
- data/spec/media_count_spec.rb +2 -0
- data/spec/media_spec.rb +1 -0
- data/spec/oauth_spec.rb +2 -0
- data/spec/photo_spec.rb +2 -0
- data/spec/set_spec.rb +1 -0
- data/spec/spec_helper.rb +20 -3
- data/spec/user_spec.rb +1 -0
- data/spec/video_spec.rb +2 -0
- metadata +92 -21
- data/credentials.rb +0 -4
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.people.findByUsername&username=Janko%20Marohni%C4%87
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="bbd163d0042874b0dfe56fb5c9dad1f3", oauth_signature="capQP%2F7g0fDMEFnzT5jH1C6iW%2BE%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337098036", oauth_token="", oauth_version="1.0"
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Tue, 15 May 2012 16:07:16 GMT
|
19
|
+
p3p:
|
20
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
21
|
+
cache-control:
|
22
|
+
- private
|
23
|
+
x-served-by:
|
24
|
+
- www4.flickr.mud.yahoo.com
|
25
|
+
vary:
|
26
|
+
- Accept-Encoding
|
27
|
+
content-length:
|
28
|
+
- "106"
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
content-type:
|
32
|
+
- application/json
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: "{\"user\":{\"id\":\"67131352@N04\", \"nsid\":\"67131352@N04\", \"username\":{\"_content\":\"Janko Marohni\\u0107\"}}, \"stat\":\"ok\"}"
|
36
|
+
http_version:
|
37
|
+
recorded_at: Tue, 15 May 2012 16:07:16 GMT
|
38
|
+
- request:
|
39
|
+
method: get
|
40
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.people.findByEmail&find_email=janko.marohnic%40gmail.com
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: ""
|
44
|
+
headers:
|
45
|
+
Authorization:
|
46
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="e1f890c835b68a4fc0156197ba87a7ef", oauth_signature="9KQMkDl39NNTMZy22szQOrLLjsc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337098036", oauth_token="", oauth_version="1.0"
|
47
|
+
response:
|
48
|
+
status:
|
49
|
+
code: 200
|
50
|
+
message:
|
51
|
+
headers:
|
52
|
+
date:
|
53
|
+
- Tue, 15 May 2012 16:07:17 GMT
|
54
|
+
p3p:
|
55
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
56
|
+
cache-control:
|
57
|
+
- private
|
58
|
+
x-served-by:
|
59
|
+
- www12.flickr.mud.yahoo.com
|
60
|
+
vary:
|
61
|
+
- Accept-Encoding
|
62
|
+
content-length:
|
63
|
+
- "106"
|
64
|
+
connection:
|
65
|
+
- close
|
66
|
+
content-type:
|
67
|
+
- application/json
|
68
|
+
body:
|
69
|
+
encoding: ASCII-8BIT
|
70
|
+
string: "{\"user\":{\"id\":\"67131352@N04\", \"nsid\":\"67131352@N04\", \"username\":{\"_content\":\"Janko Marohni\\u0107\"}}, \"stat\":\"ok\"}"
|
71
|
+
http_version:
|
72
|
+
recorded_at: Tue, 15 May 2012 16:07:17 GMT
|
73
|
+
recorded_with: VCR 2.1.1
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.people.getInfo&user_id=67131352%40N04
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="81764767ae4418713e79d1357a8ddf28", oauth_signature="BrymGEDuxLLUlHgPciWO%2FphfHtU%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013935", oauth_token="", oauth_version="1.0"
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Mon, 14 May 2012 16:45:35 GMT
|
19
|
+
p3p:
|
20
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
21
|
+
cache-control:
|
22
|
+
- private
|
23
|
+
x-served-by:
|
24
|
+
- www121.flickr.mud.yahoo.com
|
25
|
+
vary:
|
26
|
+
- Accept-Encoding
|
27
|
+
content-length:
|
28
|
+
- "416"
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
content-type:
|
32
|
+
- application/json
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: "{\"person\":{\"id\":\"67131352@N04\", \"nsid\":\"67131352@N04\", \"ispro\":0, \"iconserver\":\"5464\", \"iconfarm\":6, \"path_alias\":null, \"username\":{\"_content\":\"Janko Marohni\\u0107\"}, \"realname\":{\"_content\":\"Janko Marohni\\u0107\"}, \"location\":{\"_content\":\"Zagreb, Croatia\"}, \"timezone\":{\"label\":\"Sarajevo, Skopje, Warsaw, Zagreb\", \"offset\":\"+01:00\"}, \"description\":{\"_content\":\"I'm a programmer, and I'm gonna program a badass Ruby library for Flickr.\"}, \"photosurl\":{\"_content\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/\"}, \"profileurl\":{\"_content\":\"http:\\/\\/www.flickr.com\\/people\\/67131352@N04\\/\"}, \"mobileurl\":{\"_content\":\"http:\\/\\/m.flickr.com\\/photostream.gne?id=67099213\"}, \"photos\":{\"firstdatetaken\":{\"_content\":\"2011-03-20 12:29:43\"}, \"firstdate\":{\"_content\":\"1334832295\"}, \"count\":{\"_content\":98}}}, \"stat\":\"ok\"}"
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 14 May 2012 16:45:36 GMT
|
38
|
+
- request:
|
39
|
+
method: get
|
40
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.people.getInfo&user_id=67131352%40N04
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: ""
|
44
|
+
headers:
|
45
|
+
Authorization:
|
46
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="c9e8ac45505126c2fd826c81ca99b1f9", oauth_signature="Q34xtj4IkInWak%2BmNX39z74RsRU%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013936", oauth_token="", oauth_version="1.0"
|
47
|
+
response:
|
48
|
+
status:
|
49
|
+
code: 200
|
50
|
+
message:
|
51
|
+
headers:
|
52
|
+
date:
|
53
|
+
- Mon, 14 May 2012 16:45:36 GMT
|
54
|
+
p3p:
|
55
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
56
|
+
cache-control:
|
57
|
+
- private
|
58
|
+
x-served-by:
|
59
|
+
- www87.flickr.mud.yahoo.com
|
60
|
+
vary:
|
61
|
+
- Accept-Encoding
|
62
|
+
content-length:
|
63
|
+
- "416"
|
64
|
+
connection:
|
65
|
+
- close
|
66
|
+
content-type:
|
67
|
+
- application/json
|
68
|
+
body:
|
69
|
+
encoding: ASCII-8BIT
|
70
|
+
string: "{\"person\":{\"id\":\"67131352@N04\", \"nsid\":\"67131352@N04\", \"ispro\":0, \"iconserver\":\"5464\", \"iconfarm\":6, \"path_alias\":null, \"username\":{\"_content\":\"Janko Marohni\\u0107\"}, \"realname\":{\"_content\":\"Janko Marohni\\u0107\"}, \"location\":{\"_content\":\"Zagreb, Croatia\"}, \"timezone\":{\"label\":\"Sarajevo, Skopje, Warsaw, Zagreb\", \"offset\":\"+01:00\"}, \"description\":{\"_content\":\"I'm a programmer, and I'm gonna program a badass Ruby library for Flickr.\"}, \"photosurl\":{\"_content\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/\"}, \"profileurl\":{\"_content\":\"http:\\/\\/www.flickr.com\\/people\\/67131352@N04\\/\"}, \"mobileurl\":{\"_content\":\"http:\\/\\/m.flickr.com\\/photostream.gne?id=67099213\"}, \"photos\":{\"firstdatetaken\":{\"_content\":\"2011-03-20 12:29:43\"}, \"firstdate\":{\"_content\":\"1334832295\"}, \"count\":{\"_content\":98}}}, \"stat\":\"ok\"}"
|
71
|
+
http_version:
|
72
|
+
recorded_at: Mon, 14 May 2012 16:45:36 GMT
|
73
|
+
recorded_with: VCR 2.1.1
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.getInfo&photo_id=7093038981
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="f3336042df740ed222d4e8e90e2d28b3", oauth_signature="uhLgww5Gj6aB8t7q7m24BpKgFNk%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013937", oauth_token="", oauth_version="1.0"
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Mon, 14 May 2012 16:45:37 GMT
|
19
|
+
p3p:
|
20
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
21
|
+
cache-control:
|
22
|
+
- private
|
23
|
+
x-served-by:
|
24
|
+
- www129.flickr.mud.yahoo.com
|
25
|
+
vary:
|
26
|
+
- Accept-Encoding
|
27
|
+
content-length:
|
28
|
+
- "835"
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
content-type:
|
32
|
+
- application/json
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: "{\"photo\":{\"id\":\"7093038981\", \"secret\":\"9a616b9f6e\", \"server\":\"5457\", \"farm\":6, \"dateuploaded\":\"1334832295\", \"isfavorite\":0, \"license\":\"0\", \"safety_level\":\"0\", \"rotation\":0, \"owner\":{\"nsid\":\"67131352@N04\", \"username\":\"Janko Marohni\\u0107\", \"realname\":\"Janko Marohni\\u0107\", \"location\":\"Zagreb, Croatia\", \"iconserver\":\"5464\", \"iconfarm\":6}, \"title\":{\"_content\":\"5 meter backflip\"}, \"description\":{\"_content\":\"Description\"}, \"visibility\":{\"ispublic\":1, \"isfriend\":0, \"isfamily\":0}, \"dates\":{\"posted\":\"1334832295\", \"taken\":\"2012-04-19 03:44:55\", \"takengranularity\":\"0\", \"lastupdate\":\"1336343117\"}, \"views\":\"0\", \"editability\":{\"cancomment\":0, \"canaddmeta\":0}, \"publiceditability\":{\"cancomment\":1, \"canaddmeta\":0}, \"usage\":{\"candownload\":1, \"canblog\":0, \"canprint\":0, \"canshare\":0}, \"comments\":{\"_content\":\"1\"}, \"notes\":{\"note\":[]}, \"people\":{\"haspeople\":0}, \"tags\":{\"tag\":[{\"id\":\"67099213-7093038981-5987\", \"author\":\"67131352@N04\", \"raw\":\"Tag\", \"_content\":\"tag\", \"machine_tag\":0}]}, \"location\":{\"latitude\":45.809537, \"longitude\":15.970344, \"accuracy\":\"11\", \"context\":\"0\", \"locality\":{\"_content\":\"Zagreb\", \"place_id\":\"00j4IylZV7scWik\", \"woeid\":\"851128\"}, \"county\":{\"_content\":\"Zagreb\", \"place_id\":\"306dHrhQV7o6jm.ZUQ\", \"woeid\":\"15022257\"}, \"region\":{\"_content\":\"Grad Zagreb\", \"place_id\":\"Js1DU.pTUrpBCIKhVw\", \"woeid\":\"20070170\"}, \"country\":{\"_content\":\"Croatia\", \"place_id\":\"FunRCI5TUb6a6soTyw\", \"woeid\":\"23424843\"}, \"place_id\":\"00j4IylZV7scWik\", \"woeid\":\"851128\"}, \"geoperms\":{\"ispublic\":1, \"iscontact\":0, \"isfriend\":0, \"isfamily\":0}, \"urls\":{\"url\":[{\"type\":\"photopage\", \"_content\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\"}]}, \"media\":\"video\", \"video\":{\"ready\":1, \"failed\":0, \"pending\":0, \"duration\":\"16\", \"width\":\"352\", \"height\":\"288\"}}, \"stat\":\"ok\"}"
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 14 May 2012 16:45:37 GMT
|
38
|
+
recorded_with: VCR 2.1.1
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.getSizes&photo_id=7093038981
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="29ef69864bc8c872b8aa2ea0260c34eb", oauth_signature="E9c8VFnPrHoFqbsj2opoTzt1LS4%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013937", oauth_token="", oauth_version="1.0"
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Mon, 14 May 2012 16:45:37 GMT
|
19
|
+
p3p:
|
20
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
21
|
+
cache-control:
|
22
|
+
- private
|
23
|
+
x-served-by:
|
24
|
+
- www103.flickr.mud.yahoo.com
|
25
|
+
vary:
|
26
|
+
- Accept-Encoding
|
27
|
+
content-length:
|
28
|
+
- "457"
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
content-type:
|
32
|
+
- application/json
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: "{\"sizes\":{\"canblog\":0, \"canprint\":0, \"candownload\":1, \"size\":[{\"label\":\"Square\", \"width\":75, \"height\":75, \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_s.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/sq\\/\", \"media\":\"photo\"}, {\"label\":\"Large Square\", \"width\":\"150\", \"height\":\"150\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_q.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/q\\/\", \"media\":\"photo\"}, {\"label\":\"Thumbnail\", \"width\":\"100\", \"height\":\"82\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_t.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/t\\/\", \"media\":\"photo\"}, {\"label\":\"Small\", \"width\":\"240\", \"height\":\"196\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_m.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/s\\/\", \"media\":\"photo\"}, {\"label\":\"Small 320\", \"width\":\"320\", \"height\":262, \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_n.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/n\\/\", \"media\":\"photo\"}, {\"label\":\"Medium\", \"width\":\"352\", \"height\":\"288\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/m\\/\", \"media\":\"photo\"}, {\"label\":\"Video Player\", \"width\":\"352\", \"height\":\"288\", \"source\":\"http:\\/\\/www.flickr.com\\/apps\\/video\\/stewart.swf?v=109786&photo_id=7093038981&photo_secret=9a616b9f6e\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\", \"media\":\"video\"}, {\"label\":\"Site MP4\", \"width\":\"352\", \"height\":\"288\", \"source\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/play\\/site\\/9a616b9f6e\\/\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\", \"media\":\"video\"}, {\"label\":\"Mobile MP4\", \"width\":\"480\", \"height\":\"360\", \"source\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/play\\/mobile\\/9a616b9f6e\\/\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\", \"media\":\"video\"}]}, \"stat\":\"ok\"}"
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 14 May 2012 16:45:38 GMT
|
38
|
+
- request:
|
39
|
+
method: get
|
40
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.getSizes&photo_id=7093038981
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: ""
|
44
|
+
headers:
|
45
|
+
Authorization:
|
46
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="0d7d7033759dde4965512df56e8b6714", oauth_signature="t8wy%2BoK7Zr76H6Z4UVDiMdkAIno%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013938", oauth_token="", oauth_version="1.0"
|
47
|
+
response:
|
48
|
+
status:
|
49
|
+
code: 200
|
50
|
+
message:
|
51
|
+
headers:
|
52
|
+
date:
|
53
|
+
- Mon, 14 May 2012 16:45:38 GMT
|
54
|
+
p3p:
|
55
|
+
- policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
|
56
|
+
cache-control:
|
57
|
+
- private
|
58
|
+
x-served-by:
|
59
|
+
- www60.flickr.mud.yahoo.com
|
60
|
+
vary:
|
61
|
+
- Accept-Encoding
|
62
|
+
content-length:
|
63
|
+
- "457"
|
64
|
+
connection:
|
65
|
+
- close
|
66
|
+
content-type:
|
67
|
+
- application/json
|
68
|
+
body:
|
69
|
+
encoding: ASCII-8BIT
|
70
|
+
string: "{\"sizes\":{\"canblog\":0, \"canprint\":0, \"candownload\":1, \"size\":[{\"label\":\"Square\", \"width\":75, \"height\":75, \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_s.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/sq\\/\", \"media\":\"photo\"}, {\"label\":\"Large Square\", \"width\":\"150\", \"height\":\"150\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_q.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/q\\/\", \"media\":\"photo\"}, {\"label\":\"Thumbnail\", \"width\":\"100\", \"height\":\"82\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_t.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/t\\/\", \"media\":\"photo\"}, {\"label\":\"Small\", \"width\":\"240\", \"height\":\"196\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_m.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/s\\/\", \"media\":\"photo\"}, {\"label\":\"Small 320\", \"width\":\"320\", \"height\":262, \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e_n.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/n\\/\", \"media\":\"photo\"}, {\"label\":\"Medium\", \"width\":\"352\", \"height\":\"288\", \"source\":\"http:\\/\\/farm6.staticflickr.com\\/5457\\/7093038981_9a616b9f6e.jpg\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/sizes\\/m\\/\", \"media\":\"photo\"}, {\"label\":\"Video Player\", \"width\":\"352\", \"height\":\"288\", \"source\":\"http:\\/\\/www.flickr.com\\/apps\\/video\\/stewart.swf?v=109786&photo_id=7093038981&photo_secret=9a616b9f6e\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\", \"media\":\"video\"}, {\"label\":\"Site MP4\", \"width\":\"352\", \"height\":\"288\", \"source\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/play\\/site\\/9a616b9f6e\\/\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\", \"media\":\"video\"}, {\"label\":\"Mobile MP4\", \"width\":\"480\", \"height\":\"360\", \"source\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/play\\/mobile\\/9a616b9f6e\\/\", \"url\":\"http:\\/\\/www.flickr.com\\/photos\\/67131352@N04\\/7093038981\\/\", \"media\":\"video\"}]}, \"stat\":\"ok\"}"
|
71
|
+
http_version:
|
72
|
+
recorded_at: Mon, 14 May 2012 16:45:38 GMT
|
73
|
+
recorded_with: VCR 2.1.1
|
data/spec/instance_spec.rb
CHANGED
data/spec/license_spec.rb
CHANGED
data/spec/location_spec.rb
CHANGED
data/spec/media_count_spec.rb
CHANGED
data/spec/media_spec.rb
CHANGED
data/spec/oauth_spec.rb
CHANGED
data/spec/photo_spec.rb
CHANGED
data/spec/set_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
require 'flickrie'
|
2
2
|
require 'vcr'
|
3
|
-
require 'active_support/core_ext/hash/except'
|
4
3
|
begin
|
5
4
|
require 'debugger'
|
6
5
|
rescue LoadError
|
7
6
|
end
|
8
7
|
|
9
8
|
VCR.configure do |config|
|
10
|
-
config.cassette_library_dir = 'spec/vcr_cassettes'
|
9
|
+
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
11
10
|
config.hook_into :faraday
|
12
|
-
config.default_cassette_options = {
|
11
|
+
config.default_cassette_options = {
|
12
|
+
:record => :new_episodes,
|
13
|
+
:serialize_with => :syck,
|
14
|
+
:match_requests_on => [:method, VCR.request_matchers.uri_without_param(:api_key)]
|
15
|
+
}
|
16
|
+
config.filter_sensitive_data('API_KEY') { ENV['FLICKR_API_KEY'] }
|
17
|
+
config.filter_sensitive_data('ACCESS_TOKEN') { ENV['FLICKR_ACCESS_TOKEN'] }
|
13
18
|
end
|
14
19
|
|
15
20
|
module RSpecHelpers
|
@@ -44,6 +49,7 @@ RSpec.configure do |config|
|
|
44
49
|
# so that I can use the '@instance' object when I want to make authenticated API calls
|
45
50
|
@flickrie = Flickrie::Instance.new(ENV['FLICKR_ACCESS_TOKEN'], ENV['FLICKR_ACCESS_SECRET'])
|
46
51
|
end
|
52
|
+
config.fail_fast = true
|
47
53
|
end
|
48
54
|
|
49
55
|
PHOTO_PATH = File.join(File.expand_path(File.dirname(__FILE__)), 'files/photo.jpg').freeze
|
@@ -66,3 +72,14 @@ klasses.each do |klass|
|
|
66
72
|
end
|
67
73
|
end
|
68
74
|
end
|
75
|
+
|
76
|
+
class Hash
|
77
|
+
def except!(*keys)
|
78
|
+
keys.each { |key| delete(key) }
|
79
|
+
self
|
80
|
+
end
|
81
|
+
|
82
|
+
def except(*keys)
|
83
|
+
self.dup.except!(*keys)
|
84
|
+
end
|
85
|
+
end
|
data/spec/user_spec.rb
CHANGED
data/spec/video_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickrie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,39 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday_middleware
|
16
|
-
requirement: &
|
16
|
+
requirement: &70303607700000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.8.7
|
22
|
+
- - <
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0.9'
|
25
|
+
type: :runtime
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: *70303607700000
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: faraday
|
30
|
+
requirement: &70303607699160 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.7.6
|
36
|
+
- - <
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0.9'
|
22
39
|
type: :runtime
|
23
40
|
prerelease: false
|
24
|
-
version_requirements: *
|
41
|
+
version_requirements: *70303607699160
|
25
42
|
- !ruby/object:Gem::Dependency
|
26
43
|
name: simple_oauth
|
27
|
-
requirement: &
|
44
|
+
requirement: &70303607698120 !ruby/object:Gem::Requirement
|
28
45
|
none: false
|
29
46
|
requirements:
|
30
47
|
- - ~>
|
@@ -32,10 +49,10 @@ dependencies:
|
|
32
49
|
version: '0.1'
|
33
50
|
type: :runtime
|
34
51
|
prerelease: false
|
35
|
-
version_requirements: *
|
52
|
+
version_requirements: *70303607698120
|
36
53
|
- !ruby/object:Gem::Dependency
|
37
54
|
name: multi_xml
|
38
|
-
requirement: &
|
55
|
+
requirement: &70303607697280 !ruby/object:Gem::Requirement
|
39
56
|
none: false
|
40
57
|
requirements:
|
41
58
|
- - ~>
|
@@ -43,21 +60,21 @@ dependencies:
|
|
43
60
|
version: '0.4'
|
44
61
|
type: :runtime
|
45
62
|
prerelease: false
|
46
|
-
version_requirements: *
|
63
|
+
version_requirements: *70303607697280
|
47
64
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
65
|
+
name: rake
|
66
|
+
requirement: &70303607696480 !ruby/object:Gem::Requirement
|
50
67
|
none: false
|
51
68
|
requirements:
|
52
|
-
- -
|
69
|
+
- - ~>
|
53
70
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
71
|
+
version: '0.9'
|
55
72
|
type: :development
|
56
73
|
prerelease: false
|
57
|
-
version_requirements: *
|
74
|
+
version_requirements: *70303607696480
|
58
75
|
- !ruby/object:Gem::Dependency
|
59
76
|
name: rspec
|
60
|
-
requirement: &
|
77
|
+
requirement: &70303607695760 !ruby/object:Gem::Requirement
|
61
78
|
none: false
|
62
79
|
requirements:
|
63
80
|
- - ! '>='
|
@@ -65,18 +82,21 @@ dependencies:
|
|
65
82
|
version: '2'
|
66
83
|
type: :development
|
67
84
|
prerelease: false
|
68
|
-
version_requirements: *
|
85
|
+
version_requirements: *70303607695760
|
69
86
|
- !ruby/object:Gem::Dependency
|
70
87
|
name: vcr
|
71
|
-
requirement: &
|
88
|
+
requirement: &70303607694760 !ruby/object:Gem::Requirement
|
72
89
|
none: false
|
73
90
|
requirements:
|
74
91
|
- - ! '>='
|
75
92
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
93
|
+
version: '2'
|
94
|
+
- - <
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3'
|
77
97
|
type: :development
|
78
98
|
prerelease: false
|
79
|
-
version_requirements: *
|
99
|
+
version_requirements: *70303607694760
|
80
100
|
description: This gem is a nice wrapper for the Flickr API with an intuitive interface.
|
81
101
|
email: janko.marohnic@gmail.com
|
82
102
|
executables: []
|
@@ -89,7 +109,6 @@ files:
|
|
89
109
|
- LICENSE
|
90
110
|
- README.md
|
91
111
|
- Rakefile
|
92
|
-
- credentials.rb
|
93
112
|
- flickrie.gemspec
|
94
113
|
- lib/flickrie.rb
|
95
114
|
- lib/flickrie/api_methods.rb
|
@@ -115,6 +134,32 @@ files:
|
|
115
134
|
- spec/error_spec.rb
|
116
135
|
- spec/files/photo.jpg
|
117
136
|
- spec/files/video.mov
|
137
|
+
- spec/fixtures/vcr_cassettes/api_methods/asynchronous_upload.yml
|
138
|
+
- spec/fixtures/vcr_cassettes/api_methods/replace.yml
|
139
|
+
- spec/fixtures/vcr_cassettes/api_methods/tags.yml
|
140
|
+
- spec/fixtures/vcr_cassettes/api_methods/upload_and_delete.yml
|
141
|
+
- spec/fixtures/vcr_cassettes/error/code.yml
|
142
|
+
- spec/fixtures/vcr_cassettes/error/was_raised.yml
|
143
|
+
- spec/fixtures/vcr_cassettes/instance/calling_api_methods.yml
|
144
|
+
- spec/fixtures/vcr_cassettes/license/get.yml
|
145
|
+
- spec/fixtures/vcr_cassettes/media/from_contacts.yml
|
146
|
+
- spec/fixtures/vcr_cassettes/media/from_set.yml
|
147
|
+
- spec/fixtures/vcr_cassettes/media/get_context.yml
|
148
|
+
- spec/fixtures/vcr_cassettes/media/get_exif.yml
|
149
|
+
- spec/fixtures/vcr_cassettes/media/get_info.yml
|
150
|
+
- spec/fixtures/vcr_cassettes/media/public_from_user.yml
|
151
|
+
- spec/fixtures/vcr_cassettes/media/search.yml
|
152
|
+
- spec/fixtures/vcr_cassettes/media_count/get.yml
|
153
|
+
- spec/fixtures/vcr_cassettes/oauth/incorrect_credentials.yml
|
154
|
+
- spec/fixtures/vcr_cassettes/photo/get_info.yml
|
155
|
+
- spec/fixtures/vcr_cassettes/photo/get_sizes.yml
|
156
|
+
- spec/fixtures/vcr_cassettes/photo/search.yml
|
157
|
+
- spec/fixtures/vcr_cassettes/set/from_user.yml
|
158
|
+
- spec/fixtures/vcr_cassettes/set/get_info.yml
|
159
|
+
- spec/fixtures/vcr_cassettes/user/find_by_username_or_email.yml
|
160
|
+
- spec/fixtures/vcr_cassettes/user/get_info.yml
|
161
|
+
- spec/fixtures/vcr_cassettes/video/get_info.yml
|
162
|
+
- spec/fixtures/vcr_cassettes/video/get_sizes.yml
|
118
163
|
- spec/instance_spec.rb
|
119
164
|
- spec/license_spec.rb
|
120
165
|
- spec/location_spec.rb
|
@@ -138,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
183
|
requirements:
|
139
184
|
- - ! '>='
|
140
185
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
186
|
+
version: 1.9.2
|
142
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
188
|
none: false
|
144
189
|
requirements:
|
@@ -159,6 +204,32 @@ test_files:
|
|
159
204
|
- spec/error_spec.rb
|
160
205
|
- spec/files/photo.jpg
|
161
206
|
- spec/files/video.mov
|
207
|
+
- spec/fixtures/vcr_cassettes/api_methods/asynchronous_upload.yml
|
208
|
+
- spec/fixtures/vcr_cassettes/api_methods/replace.yml
|
209
|
+
- spec/fixtures/vcr_cassettes/api_methods/tags.yml
|
210
|
+
- spec/fixtures/vcr_cassettes/api_methods/upload_and_delete.yml
|
211
|
+
- spec/fixtures/vcr_cassettes/error/code.yml
|
212
|
+
- spec/fixtures/vcr_cassettes/error/was_raised.yml
|
213
|
+
- spec/fixtures/vcr_cassettes/instance/calling_api_methods.yml
|
214
|
+
- spec/fixtures/vcr_cassettes/license/get.yml
|
215
|
+
- spec/fixtures/vcr_cassettes/media/from_contacts.yml
|
216
|
+
- spec/fixtures/vcr_cassettes/media/from_set.yml
|
217
|
+
- spec/fixtures/vcr_cassettes/media/get_context.yml
|
218
|
+
- spec/fixtures/vcr_cassettes/media/get_exif.yml
|
219
|
+
- spec/fixtures/vcr_cassettes/media/get_info.yml
|
220
|
+
- spec/fixtures/vcr_cassettes/media/public_from_user.yml
|
221
|
+
- spec/fixtures/vcr_cassettes/media/search.yml
|
222
|
+
- spec/fixtures/vcr_cassettes/media_count/get.yml
|
223
|
+
- spec/fixtures/vcr_cassettes/oauth/incorrect_credentials.yml
|
224
|
+
- spec/fixtures/vcr_cassettes/photo/get_info.yml
|
225
|
+
- spec/fixtures/vcr_cassettes/photo/get_sizes.yml
|
226
|
+
- spec/fixtures/vcr_cassettes/photo/search.yml
|
227
|
+
- spec/fixtures/vcr_cassettes/set/from_user.yml
|
228
|
+
- spec/fixtures/vcr_cassettes/set/get_info.yml
|
229
|
+
- spec/fixtures/vcr_cassettes/user/find_by_username_or_email.yml
|
230
|
+
- spec/fixtures/vcr_cassettes/user/get_info.yml
|
231
|
+
- spec/fixtures/vcr_cassettes/video/get_info.yml
|
232
|
+
- spec/fixtures/vcr_cassettes/video/get_sizes.yml
|
162
233
|
- spec/instance_spec.rb
|
163
234
|
- spec/license_spec.rb
|
164
235
|
- spec/location_spec.rb
|
data/credentials.rb
DELETED