flickrie 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/README.md +1 -0
- data/flickrie.gemspec +6 -6
- data/lib/flickrie/api_methods.rb +13 -0
- data/lib/flickrie/client.rb +5 -0
- data/lib/flickrie/user.rb +4 -4
- data/lib/flickrie/version.rb +1 -1
- data/spec/api_methods_spec.rb +34 -36
- data/spec/error_spec.rb +3 -9
- data/spec/fixtures/vcr_cassettes/api_methods/tag_manipulation.yml +178 -0
- data/spec/fixtures/vcr_cassettes/error/a_request_was_made_and_failed.yml +84 -0
- data/spec/fixtures/vcr_cassettes/media/from_user.yml +38 -0
- data/spec/fixtures/vcr_cassettes/{oauth → o_auth}/incorrect_credentials.yml +28 -28
- data/spec/instance_spec.rb +13 -17
- data/spec/license_spec.rb +2 -4
- data/spec/media_count_spec.rb +1 -3
- data/spec/media_spec.rb +18 -18
- data/spec/oauth_spec.rb +1 -3
- data/spec/photo_spec.rb +3 -9
- data/spec/set_spec.rb +2 -6
- data/spec/spec_helper.rb +37 -17
- data/spec/user_spec.rb +2 -6
- data/spec/video_spec.rb +2 -6
- metadata +27 -27
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -244,6 +244,7 @@ basis of this gem.
|
|
244
244
|
"flickr.people.findByEmail" -> Flickrie.find_user_by_email
|
245
245
|
"flickr.people.findByUsername" -> Flickrie.find_user_by_username
|
246
246
|
"flickr.people.getInfo" -> Flickrie.get_user_info
|
247
|
+
"flickr.people.getPhotos" -> Flickrie.photos_from_user
|
247
248
|
"flickr.people.getPublicPhotos" -> Flickrie.public_photos_from_user
|
248
249
|
|
249
250
|
# photos
|
data/flickrie.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
require File.expand_path("../lib/flickrie/version", __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.
|
5
|
+
gem.name = "flickrie"
|
6
|
+
gem.version = Flickrie::VERSION
|
6
7
|
|
7
8
|
gem.author = "Janko Marohnić"
|
8
9
|
gem.email = "janko.marohnic@gmail.com"
|
9
|
-
gem.description = %q{This gem
|
10
|
-
gem.summary = %q{
|
10
|
+
gem.description = %q{This gem wraps the Flickr API with a nice object-oriented interface.}
|
11
|
+
gem.summary = %q{This gem wraps the Flickr API with a nice object-oriented interface.}
|
11
12
|
gem.homepage = "https://github.com/janko-m/flickrie"
|
12
13
|
|
13
14
|
gem.files = `git ls-files`.split($\)
|
14
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
15
|
-
gem.name = "flickrie"
|
16
15
|
gem.require_path = "lib"
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
17
|
|
18
18
|
gem.license = "MIT"
|
19
19
|
|
@@ -26,5 +26,5 @@ Gem::Specification.new do |gem|
|
|
26
26
|
|
27
27
|
gem.add_development_dependency "rake", '~> 0.9'
|
28
28
|
gem.add_development_dependency "rspec", '>= 2'
|
29
|
-
gem.add_development_dependency "vcr", '
|
29
|
+
gem.add_development_dependency "vcr", '~> 2.1'
|
30
30
|
end
|
data/lib/flickrie/api_methods.rb
CHANGED
@@ -66,6 +66,19 @@ module Flickrie
|
|
66
66
|
User.from_info(response.body['person'])
|
67
67
|
end
|
68
68
|
|
69
|
+
def media_from_user(user_nsid, params = {})
|
70
|
+
response = client.media_from_user(user_nsid, params)
|
71
|
+
Media.from_user(response.body['photos'])
|
72
|
+
end
|
73
|
+
def photos_from_user(user_nsid, params = {})
|
74
|
+
media_from_user(user_nsid, params).
|
75
|
+
select { |media| media.is_a?(Photo) }
|
76
|
+
end
|
77
|
+
def videos_from_user(user_nsid, params = {})
|
78
|
+
media_from_user(user_nsid, params).
|
79
|
+
select { |media| media.is_a?(Video) }
|
80
|
+
end
|
81
|
+
|
69
82
|
def public_media_from_user(user_nsid, params = {})
|
70
83
|
response = client.public_media_from_user(user_nsid, params)
|
71
84
|
Media.from_user(response.body['photos'])
|
data/lib/flickrie/client.rb
CHANGED
@@ -123,6 +123,11 @@ module Flickrie
|
|
123
123
|
{:user_id => user_nsid}.merge(params)
|
124
124
|
end
|
125
125
|
|
126
|
+
def media_from_user(user_nsid, params = {})
|
127
|
+
get 'flickr.people.getPhotos',
|
128
|
+
ensure_media({:user_id => user_nsid}.merge(params))
|
129
|
+
end
|
130
|
+
|
126
131
|
def public_media_from_user(user_nsid, params = {})
|
127
132
|
get 'flickr.people.getPublicPhotos',
|
128
133
|
ensure_media({:user_id => user_nsid}.merge(params))
|
data/lib/flickrie/user.rb
CHANGED
@@ -18,8 +18,8 @@ module Flickrie
|
|
18
18
|
|
19
19
|
def buddy_icon_url
|
20
20
|
if icon_farm
|
21
|
-
if icon_server.to_i > 0
|
22
|
-
"http://farm{#{icon_farm}}.staticflickr.com/{#{icon_server}}/buddyicons/#{nsid}.jpg"
|
21
|
+
if icon_server.to_i > 0 && (nsid || id)
|
22
|
+
"http://farm{#{icon_farm}}.staticflickr.com/{#{icon_server}}/buddyicons/#{nsid || id}.jpg"
|
23
23
|
else
|
24
24
|
"http://www.flickr.com/images/buddyicon.jpg"
|
25
25
|
end
|
@@ -41,7 +41,7 @@ module Flickrie
|
|
41
41
|
|
42
42
|
# The same as calling <tt>Flickrie.public_photos_from_user(user.nsid)</tt>
|
43
43
|
#
|
44
|
-
def public_photos() Flickrie.public_photos_from_user(nsid) end
|
44
|
+
def public_photos() Flickrie.public_photos_from_user(nsid || id) end
|
45
45
|
|
46
46
|
def pro?() Integer(@info['ispro']) == 1 rescue nil end
|
47
47
|
|
@@ -51,7 +51,7 @@ module Flickrie
|
|
51
51
|
# The same as calling <tt>Flickrie.get_user_info(user.nsid)</tt>
|
52
52
|
#
|
53
53
|
def get_info(params = {}, info = nil)
|
54
|
-
info ||= Flickrie.client.get_user_info(nsid, params).body['person']
|
54
|
+
info ||= Flickrie.client.get_user_info(nsid || id, params).body['person']
|
55
55
|
@info.update(info)
|
56
56
|
|
57
57
|
%w[username realname location description profileurl
|
data/lib/flickrie/version.rb
CHANGED
data/spec/api_methods_spec.rb
CHANGED
@@ -1,45 +1,43 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
|
2
2
|
|
3
3
|
describe Flickrie::ApiMethods do
|
4
|
-
it "should
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
4
|
+
it "should upload and delete correctly", :vcr, :cassette => "upload and delete" do
|
5
|
+
media_id = @flickrie.upload(PHOTO_PATH)
|
6
|
+
@flickrie.public_media_from_user(USER_NSID).map(&:id).should include(media_id)
|
7
|
+
@flickrie.delete_media(media_id)
|
8
|
+
@flickrie.public_media_from_user(USER_NSID).map(&:id).should_not include(media_id)
|
9
|
+
end
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
it "should upload asynchronously correctly", :vcr, :cassette => "asynchronous upload" do
|
12
|
+
ticket_id = @flickrie.upload(PHOTO_PATH, :async => 1)
|
13
|
+
begin
|
14
|
+
ticket = @flickrie.check_upload_tickets([ticket_id]).first
|
15
|
+
end until ticket.complete?
|
16
|
+
photo_id = ticket.photo_id
|
17
|
+
Flickrie.get_photo_info(photo_id).id.should eq(photo_id)
|
18
|
+
@flickrie.delete_photo(photo_id)
|
19
|
+
end
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
21
|
+
it "should replace correctly", :vcr, :cassette => "replace" do
|
22
|
+
begin
|
23
|
+
id = @flickrie.upload(PHOTO_PATH)
|
24
|
+
@flickrie.replace(PHOTO_PATH, id)
|
25
|
+
rescue => exception
|
26
|
+
exception.code.should eq(1) # Not a pro account
|
27
|
+
ensure
|
28
|
+
@flickrie.delete_media(id)
|
31
29
|
end
|
30
|
+
end
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
32
|
+
it "should manipulate tags correctly", :vcr, :cassette => "tag manipulation" do
|
33
|
+
media = @flickrie.get_media_info(PHOTO_ID)
|
34
|
+
tags_before_change = media.tags.join(' ')
|
35
|
+
@flickrie.add_media_tags(PHOTO_ID, "janko")
|
36
|
+
media.get_info
|
37
|
+
media.tags.join(' ').should eq([tags_before_change, "janko"].join(' '))
|
38
|
+
tag_id = media.tags.find { |tag| tag.content == "janko" }.id
|
39
|
+
@flickrie.remove_media_tag(tag_id)
|
40
|
+
media.get_info
|
41
|
+
media.tags.join(' ').should eq(tags_before_change)
|
44
42
|
end
|
45
43
|
end
|
data/spec/error_spec.rb
CHANGED
@@ -5,19 +5,13 @@ describe Flickrie::Error do
|
|
5
5
|
Flickrie.api_key = nil
|
6
6
|
end
|
7
7
|
|
8
|
-
context "was
|
9
|
-
|
10
|
-
|
11
|
-
it "should be raised when the request failed" do
|
8
|
+
context "a request was made and failed" do
|
9
|
+
it "should be raised", :vcr do
|
12
10
|
expect { Flickrie.get_licenses }.to raise_error(described_class)
|
13
11
|
expect { Flickrie.upload(PHOTO_PATH) }.to raise_error(described_class)
|
14
12
|
end
|
15
|
-
end
|
16
|
-
|
17
|
-
context "code" do
|
18
|
-
use_vcr_cassette "error/code"
|
19
13
|
|
20
|
-
it "should have #code attribute present" do
|
14
|
+
it "should have #code attribute present", :vcr do
|
21
15
|
begin
|
22
16
|
Flickrie.get_licenses
|
23
17
|
rescue => exception
|
@@ -0,0 +1,178 @@
|
|
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=6946979188
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="38acd105d61327bee989414b06bd1772", oauth_signature="5zhRDjd3xFVGL2K5fPeasC1pUCw%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106961", oauth_token="ACCESS_TOKEN", oauth_version="1.0"
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Tue, 15 May 2012 18:36:02 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
|
+
- www210.flickr.mud.yahoo.com
|
25
|
+
vary:
|
26
|
+
- Accept-Encoding
|
27
|
+
content-length:
|
28
|
+
- "843"
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
content-type:
|
32
|
+
- application/json
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: "{\"photo\":{\"id\":\"6946979188\", \"secret\":\"25bb44852b\", \"server\":\"7049\", \"farm\":8, \"dateuploaded\":\"1334832745\", \"isfavorite\":0, \"license\":\"0\", \"safety_level\":\"0\", \"rotation\":90, \"owner\":{\"nsid\":\"67131352@N04\", \"username\":\"Janko Marohni\\u0107\", \"realname\":\"Janko Marohni\\u0107\", \"location\":\"Zagreb, Croatia\", \"iconserver\":\"5464\", \"iconfarm\":6}, \"title\":{\"_content\":\"IMG_0796\"}, \"description\":{\"_content\":\"Test\"}, \"visibility\":{\"ispublic\":1, \"isfriend\":0, \"isfamily\":0}, \"dates\":{\"posted\":\"1334832745\", \"taken\":\"2011-03-20 17:00:05\", \"takengranularity\":\"0\", \"lastupdate\":\"1337013893\"}, \"permissions\":{\"permcomment\":3, \"permaddmeta\":2}, \"views\":\"4\", \"editability\":{\"cancomment\":1, \"canaddmeta\":1}, \"publiceditability\":{\"cancomment\":1, \"canaddmeta\":0}, \"usage\":{\"candownload\":1, \"canblog\":1, \"canprint\":1, \"canshare\":0}, \"comments\":{\"_content\":\"1\"}, \"notes\":{\"note\":[{\"id\":\"72157629487842968\", \"author\":\"67131352@N04\", \"authorname\":\"Janko Marohni\\u0107\", \"x\":\"316\", \"y\":\"0\", \"w\":\"59\", \"h\":\"50\", \"_content\":\"Test\"}]}, \"people\":{\"haspeople\":0}, \"tags\":{\"tag\":[{\"id\":\"67099213-6946979188-89662\", \"author\":\"67131352@N04\", \"raw\":\"luka\", \"_content\":\"luka\", \"machine_tag\":0}]}, \"location\":{\"latitude\":45.807258, \"longitude\":15.967599, \"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\\/6946979188\\/\"}]}, \"media\":\"photo\"}, \"stat\":\"ok\"}"
|
36
|
+
http_version:
|
37
|
+
recorded_at: Tue, 15 May 2012 18:36:02 GMT
|
38
|
+
- request:
|
39
|
+
method: post
|
40
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.addTags&photo_id=6946979188&tags=janko
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: ""
|
44
|
+
headers:
|
45
|
+
Authorization:
|
46
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="92602315336949ab3fdf50d36dc30bd7", oauth_signature="Wdjdc%2FcJNr2WP%2Bg%2BugWtg6zS2ec%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106962", oauth_token="ACCESS_TOKEN", oauth_version="1.0"
|
47
|
+
response:
|
48
|
+
status:
|
49
|
+
code: 200
|
50
|
+
message:
|
51
|
+
headers:
|
52
|
+
date:
|
53
|
+
- Tue, 15 May 2012 18:36:03 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
|
+
- www20.flickr.mud.yahoo.com
|
60
|
+
vary:
|
61
|
+
- Accept-Encoding
|
62
|
+
content-length:
|
63
|
+
- "13"
|
64
|
+
connection:
|
65
|
+
- close
|
66
|
+
content-type:
|
67
|
+
- application/json
|
68
|
+
body:
|
69
|
+
encoding: US-ASCII
|
70
|
+
string: "{\"stat\":\"ok\"}"
|
71
|
+
http_version:
|
72
|
+
recorded_at: Tue, 15 May 2012 18:36:03 GMT
|
73
|
+
- request:
|
74
|
+
method: get
|
75
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.getInfo&photo_id=6946979188
|
76
|
+
body:
|
77
|
+
encoding: US-ASCII
|
78
|
+
string: ""
|
79
|
+
headers:
|
80
|
+
Authorization:
|
81
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="322c998fefee710f1db0c8423456ffcb", oauth_signature="tJUx3w1ahyNfTBWCEnwQm631v6Q%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106963", oauth_token="", oauth_version="1.0"
|
82
|
+
response:
|
83
|
+
status:
|
84
|
+
code: 200
|
85
|
+
message:
|
86
|
+
headers:
|
87
|
+
date:
|
88
|
+
- Tue, 15 May 2012 18:36:03 GMT
|
89
|
+
p3p:
|
90
|
+
- 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"
|
91
|
+
cache-control:
|
92
|
+
- private
|
93
|
+
x-served-by:
|
94
|
+
- www28.flickr.mud.yahoo.com
|
95
|
+
vary:
|
96
|
+
- Accept-Encoding
|
97
|
+
content-length:
|
98
|
+
- "846"
|
99
|
+
connection:
|
100
|
+
- close
|
101
|
+
content-type:
|
102
|
+
- application/json
|
103
|
+
body:
|
104
|
+
encoding: ASCII-8BIT
|
105
|
+
string: "{\"photo\":{\"id\":\"6946979188\", \"secret\":\"25bb44852b\", \"server\":\"7049\", \"farm\":8, \"dateuploaded\":\"1334832745\", \"isfavorite\":0, \"license\":\"0\", \"safety_level\":\"0\", \"rotation\":90, \"owner\":{\"nsid\":\"67131352@N04\", \"username\":\"Janko Marohni\\u0107\", \"realname\":\"Janko Marohni\\u0107\", \"location\":\"Zagreb, Croatia\", \"iconserver\":\"5464\", \"iconfarm\":6}, \"title\":{\"_content\":\"IMG_0796\"}, \"description\":{\"_content\":\"Test\"}, \"visibility\":{\"ispublic\":1, \"isfriend\":0, \"isfamily\":0}, \"dates\":{\"posted\":\"1334832745\", \"taken\":\"2011-03-20 17:00:05\", \"takengranularity\":\"0\", \"lastupdate\":\"1337106963\"}, \"views\":\"4\", \"editability\":{\"cancomment\":0, \"canaddmeta\":0}, \"publiceditability\":{\"cancomment\":1, \"canaddmeta\":0}, \"usage\":{\"candownload\":1, \"canblog\":0, \"canprint\":0, \"canshare\":0}, \"comments\":{\"_content\":\"1\"}, \"notes\":{\"note\":[{\"id\":\"72157629487842968\", \"author\":\"67131352@N04\", \"authorname\":\"Janko Marohni\\u0107\", \"x\":\"316\", \"y\":\"0\", \"w\":\"59\", \"h\":\"50\", \"_content\":\"Test\"}]}, \"people\":{\"haspeople\":0}, \"tags\":{\"tag\":[{\"id\":\"67099213-6946979188-89662\", \"author\":\"67131352@N04\", \"raw\":\"luka\", \"_content\":\"luka\", \"machine_tag\":0}, {\"id\":\"67099213-6946979188-257458\", \"author\":\"67131352@N04\", \"raw\":\"janko\", \"_content\":\"janko\", \"machine_tag\":0}]}, \"location\":{\"latitude\":45.807258, \"longitude\":15.967599, \"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\\/6946979188\\/\"}]}, \"media\":\"photo\"}, \"stat\":\"ok\"}"
|
106
|
+
http_version:
|
107
|
+
recorded_at: Tue, 15 May 2012 18:36:04 GMT
|
108
|
+
- request:
|
109
|
+
method: post
|
110
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.removeTag&tag_id=67099213-6946979188-257458
|
111
|
+
body:
|
112
|
+
encoding: US-ASCII
|
113
|
+
string: ""
|
114
|
+
headers:
|
115
|
+
Authorization:
|
116
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="c999a1ffb6534901e47bdb6522ce0bca", oauth_signature="ClZymILnP%2FU1JrqpX3eICVe3%2B7k%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106964", oauth_token="ACCESS_TOKEN", oauth_version="1.0"
|
117
|
+
response:
|
118
|
+
status:
|
119
|
+
code: 200
|
120
|
+
message:
|
121
|
+
headers:
|
122
|
+
date:
|
123
|
+
- Tue, 15 May 2012 18:36:04 GMT
|
124
|
+
p3p:
|
125
|
+
- 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"
|
126
|
+
cache-control:
|
127
|
+
- private
|
128
|
+
x-served-by:
|
129
|
+
- www203.flickr.mud.yahoo.com
|
130
|
+
vary:
|
131
|
+
- Accept-Encoding
|
132
|
+
content-length:
|
133
|
+
- "13"
|
134
|
+
connection:
|
135
|
+
- close
|
136
|
+
content-type:
|
137
|
+
- application/json
|
138
|
+
body:
|
139
|
+
encoding: US-ASCII
|
140
|
+
string: "{\"stat\":\"ok\"}"
|
141
|
+
http_version:
|
142
|
+
recorded_at: Tue, 15 May 2012 18:36:04 GMT
|
143
|
+
- request:
|
144
|
+
method: get
|
145
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key=API_KEY&method=flickr.photos.getInfo&photo_id=6946979188
|
146
|
+
body:
|
147
|
+
encoding: US-ASCII
|
148
|
+
string: ""
|
149
|
+
headers:
|
150
|
+
Authorization:
|
151
|
+
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="a2852d4a3571f94a033f5ef3358d9002", oauth_signature="jYTthTwzAvt%2BOK%2BhXKnN4pCUPOA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106964", oauth_token="", oauth_version="1.0"
|
152
|
+
response:
|
153
|
+
status:
|
154
|
+
code: 200
|
155
|
+
message:
|
156
|
+
headers:
|
157
|
+
date:
|
158
|
+
- Tue, 15 May 2012 18:36:05 GMT
|
159
|
+
p3p:
|
160
|
+
- 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"
|
161
|
+
cache-control:
|
162
|
+
- private
|
163
|
+
x-served-by:
|
164
|
+
- www42.flickr.mud.yahoo.com
|
165
|
+
vary:
|
166
|
+
- Accept-Encoding
|
167
|
+
content-length:
|
168
|
+
- "826"
|
169
|
+
connection:
|
170
|
+
- close
|
171
|
+
content-type:
|
172
|
+
- application/json
|
173
|
+
body:
|
174
|
+
encoding: ASCII-8BIT
|
175
|
+
string: "{\"photo\":{\"id\":\"6946979188\", \"secret\":\"25bb44852b\", \"server\":\"7049\", \"farm\":8, \"dateuploaded\":\"1334832745\", \"isfavorite\":0, \"license\":\"0\", \"safety_level\":\"0\", \"rotation\":90, \"owner\":{\"nsid\":\"67131352@N04\", \"username\":\"Janko Marohni\\u0107\", \"realname\":\"Janko Marohni\\u0107\", \"location\":\"Zagreb, Croatia\", \"iconserver\":\"5464\", \"iconfarm\":6}, \"title\":{\"_content\":\"IMG_0796\"}, \"description\":{\"_content\":\"Test\"}, \"visibility\":{\"ispublic\":1, \"isfriend\":0, \"isfamily\":0}, \"dates\":{\"posted\":\"1334832745\", \"taken\":\"2011-03-20 17:00:05\", \"takengranularity\":\"0\", \"lastupdate\":\"1337106964\"}, \"views\":\"4\", \"editability\":{\"cancomment\":0, \"canaddmeta\":0}, \"publiceditability\":{\"cancomment\":1, \"canaddmeta\":0}, \"usage\":{\"candownload\":1, \"canblog\":0, \"canprint\":0, \"canshare\":0}, \"comments\":{\"_content\":\"1\"}, \"notes\":{\"note\":[{\"id\":\"72157629487842968\", \"author\":\"67131352@N04\", \"authorname\":\"Janko Marohni\\u0107\", \"x\":\"316\", \"y\":\"0\", \"w\":\"59\", \"h\":\"50\", \"_content\":\"Test\"}]}, \"people\":{\"haspeople\":0}, \"tags\":{\"tag\":[{\"id\":\"67099213-6946979188-89662\", \"author\":\"67131352@N04\", \"raw\":\"luka\", \"_content\":\"luka\", \"machine_tag\":0}]}, \"location\":{\"latitude\":45.807258, \"longitude\":15.967599, \"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\\/6946979188\\/\"}]}, \"media\":\"photo\"}, \"stat\":\"ok\"}"
|
176
|
+
http_version:
|
177
|
+
recorded_at: Tue, 15 May 2012 18:36:05 GMT
|
178
|
+
recorded_with: VCR 2.1.1
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.flickr.com/services/rest?format=json&nojsoncallback=1&api_key&method=flickr.photos.licenses.getInfo
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- OAuth oauth_consumer_key="", oauth_nonce="9015665b754be8ec9bd9fcd5d3dfa651", oauth_signature="7HdDBQN0fTShBFL%2BQQ3rVrHMdhk%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106970", oauth_token="", oauth_version="1.0"
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
date:
|
18
|
+
- Tue, 15 May 2012 18:36:11 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
|
+
access-control-allow-origin:
|
22
|
+
- "*"
|
23
|
+
cache-control:
|
24
|
+
- private
|
25
|
+
x-served-by:
|
26
|
+
- www24.flickr.mud.yahoo.com
|
27
|
+
vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
content-length:
|
30
|
+
- "91"
|
31
|
+
connection:
|
32
|
+
- close
|
33
|
+
content-type:
|
34
|
+
- text/plain; charset=utf-8
|
35
|
+
body:
|
36
|
+
encoding: ASCII-8BIT
|
37
|
+
string: "{\"stat\":\"fail\", \"code\":100, \"message\":\"Invalid API Key (Key has invalid format)\"}"
|
38
|
+
http_version:
|
39
|
+
recorded_at: Tue, 15 May 2012 18:36:11 GMT
|
40
|
+
- request:
|
41
|
+
method: post
|
42
|
+
uri: http://api.flickr.com/services/upload
|
43
|
+
body:
|
44
|
+
encoding: ASCII-8BIT
|
45
|
+
string: "#<Faraday::CompositeReadIO:0x007fe135a1f568>"
|
46
|
+
headers:
|
47
|
+
Authorization:
|
48
|
+
- OAuth oauth_consumer_key="", oauth_nonce="14fea8fb475e896e7a57153105ab0c76", oauth_signature="81Hz9uxYjntqJiHvrTHxjSrAq80%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106971", oauth_token="", oauth_version="1.0"
|
49
|
+
Content-Type:
|
50
|
+
- multipart/form-data;boundary=-----------RubyMultipartPost
|
51
|
+
Content-Length:
|
52
|
+
- "47086"
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message:
|
57
|
+
headers:
|
58
|
+
date:
|
59
|
+
- Tue, 15 May 2012 18:36:11 GMT
|
60
|
+
p3p:
|
61
|
+
- 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"
|
62
|
+
connection:
|
63
|
+
- close
|
64
|
+
content-length:
|
65
|
+
- "132"
|
66
|
+
cache-control:
|
67
|
+
- private
|
68
|
+
x-served-by:
|
69
|
+
- www97.flickr.mud.yahoo.com
|
70
|
+
vary:
|
71
|
+
- Accept-Encoding
|
72
|
+
content-type:
|
73
|
+
- text/xml; charset=utf-8
|
74
|
+
body:
|
75
|
+
encoding: US-ASCII
|
76
|
+
string: |
|
77
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
78
|
+
<rsp stat="fail">
|
79
|
+
<err code="100" msg="Invalid API Key (Key has invalid format)" />
|
80
|
+
</rsp>
|
81
|
+
|
82
|
+
http_version:
|
83
|
+
recorded_at: Tue, 15 May 2012 18:36:12 GMT
|
84
|
+
recorded_with: VCR 2.1.1
|