flickrie 0.7.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +70 -30
- data/Gemfile +5 -4
- data/README.md +55 -53
- data/Rakefile +6 -9
- data/lib/flickrie/api_methods.rb +16 -3
- data/lib/flickrie/client.rb +11 -40
- data/lib/flickrie/instance.rb +0 -1
- data/lib/flickrie/location.rb +21 -18
- data/lib/flickrie/media.rb +5 -21
- data/lib/flickrie/media_count.rb +4 -0
- data/lib/flickrie/middleware.rb +71 -0
- data/lib/flickrie/oauth.rb +58 -49
- data/lib/flickrie/photo.rb +0 -2
- data/lib/flickrie/set.rb +0 -5
- data/lib/flickrie/upload_client.rb +45 -56
- data/lib/flickrie/user.rb +10 -10
- data/lib/flickrie/version.rb +1 -1
- data/lib/flickrie/video.rb +0 -2
- data/spec/files/photo.bla +0 -0
- data/spec/{api_methods_spec.rb → flickrie/api_methods_spec.rb} +14 -14
- data/spec/{error_spec.rb → flickrie/error_spec.rb} +1 -1
- data/spec/{instance_spec.rb → flickrie/instance_spec.rb} +2 -5
- data/spec/{license_spec.rb → flickrie/license_spec.rb} +1 -1
- data/spec/{location_spec.rb → flickrie/location_spec.rb} +12 -1
- data/spec/{media_count_spec.rb → flickrie/media_count_spec.rb} +7 -3
- data/spec/{media_spec.rb → flickrie/media_spec.rb} +25 -26
- data/spec/flickrie/oauth_spec.rb +25 -0
- data/spec/{photo_spec.rb → flickrie/photo_spec.rb} +1 -1
- data/spec/{set_spec.rb → flickrie/set_spec.rb} +2 -2
- data/spec/flickrie/upload_client_spec.rb +40 -0
- data/spec/flickrie/user_spec.rb +58 -0
- data/spec/{video_spec.rb → flickrie/video_spec.rb} +1 -1
- data/spec/spec_helper.rb +16 -13
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/api_methods/asynchronous_upload.yml +60 -95
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/api_methods/replace.yml +16 -16
- data/spec/{fixtures/vcr_cassettes/api_methods/tags.yml → vcr_cassettes/api_methods/tag_manipulation.yml} +24 -24
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/api_methods/upload_and_delete.yml +21 -21
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/error/a_request_was_made_and_failed.yml +9 -9
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/instance/calling_api_methods.yml +32 -32
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/license/get.yml +4 -4
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/from_contacts.yml +8 -8
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/from_set.yml +5 -5
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/from_user.yml +5 -5
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/get_context.yml +4 -4
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/get_exif.yml +8 -8
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/get_info.yml +18 -18
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/public_from_user.yml +5 -5
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media/search.yml +5 -5
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/media_count/get.yml +8 -8
- data/spec/vcr_cassettes/o_auth/incorrect_credentials.yml +249 -0
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/photo/get_info.yml +6 -6
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/photo/get_sizes.yml +12 -12
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/photo/search.yml +5 -5
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/set/from_user.yml +16 -16
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/set/get_info.yml +32 -32
- data/spec/vcr_cassettes/upload_client/content_type.yml +117 -0
- data/spec/vcr_cassettes/upload_client/invalid_credentials.yml +208 -0
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/user/find_by_username_or_email.yml +8 -8
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/user/get_info.yml +8 -8
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/video/get_info.yml +4 -4
- data/spec/{fixtures/vcr_cassettes → vcr_cassettes}/video/get_sizes.yml +8 -8
- metadata +105 -99
- data/spec/fixtures/vcr_cassettes/api_methods/tag_manipulation.yml +0 -178
- data/spec/fixtures/vcr_cassettes/error/code.yml +0 -84
- data/spec/fixtures/vcr_cassettes/error/was_raised.yml +0 -84
- data/spec/fixtures/vcr_cassettes/o_auth/incorrect_credentials.yml +0 -167
- data/spec/oauth_spec.rb +0 -22
- data/spec/user_spec.rb +0 -53
@@ -1,84 +0,0 @@
|
|
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="e3cc9dda9867f44cc5b73d1086dd1254", oauth_signature="j1Y5Yy8EBCSoKfSMQ1WYvFUz9d0%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013895", 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:44:55 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
|
-
- www120.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: Mon, 14 May 2012 16:44:55 GMT
|
40
|
-
- request:
|
41
|
-
method: post
|
42
|
-
uri: http://api.flickr.com/services/upload
|
43
|
-
body:
|
44
|
-
encoding: ASCII-8BIT
|
45
|
-
string: "#<Faraday::CompositeReadIO:0x007ffa68f8fb50>"
|
46
|
-
headers:
|
47
|
-
Authorization:
|
48
|
-
- OAuth oauth_consumer_key="", oauth_nonce="fdbdd822dc74a0daea9eabe8d5c20433", oauth_signature="laCMA2oyUNvHuz0uc5Cl6tS5ais%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013895", 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
|
-
- Mon, 14 May 2012 16:44:56 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
|
-
- www110.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: Mon, 14 May 2012 16:44:56 GMT
|
84
|
-
recorded_with: VCR 2.1.1
|
@@ -1,84 +0,0 @@
|
|
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="7184a992d730edcb93569f134a733a04", oauth_signature="MmojtJI5wFmA1CS%2F2yBL1%2FjeZho%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013893", 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:44:54 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
|
-
- www84.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: Mon, 14 May 2012 16:44:54 GMT
|
40
|
-
- request:
|
41
|
-
method: post
|
42
|
-
uri: http://api.flickr.com/services/upload
|
43
|
-
body:
|
44
|
-
encoding: ASCII-8BIT
|
45
|
-
string: "#<Faraday::CompositeReadIO:0x007ffa68f46400>"
|
46
|
-
headers:
|
47
|
-
Authorization:
|
48
|
-
- OAuth oauth_consumer_key="", oauth_nonce="ee4bb6862b61b5ca364a928e2301995e", oauth_signature="zJrYouawLgCDmQBLFwvV7DEhnVg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337013894", 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
|
-
- Mon, 14 May 2012 16:44:54 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
|
-
- www229.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: Mon, 14 May 2012 16:44:55 GMT
|
84
|
-
recorded_with: VCR 2.1.1
|
@@ -1,167 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://www.flickr.com/services/oauth/request_token?oauth_callback=oob
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ""
|
9
|
-
headers:
|
10
|
-
Authorization:
|
11
|
-
- OAuth oauth_consumer_key="foo", oauth_nonce="343828b763700300dc63df28dee85a7c", oauth_signature="qv48Khp9bvT4WvEhHMMbtSFCnQE%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106972", oauth_version="1.0"
|
12
|
-
response:
|
13
|
-
status:
|
14
|
-
code: 401
|
15
|
-
message:
|
16
|
-
headers:
|
17
|
-
date:
|
18
|
-
- Tue, 15 May 2012 18:36:13 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
|
-
set-cookie:
|
22
|
-
- localization=en-us%3Bus%3Bus; expires=Tue, 13-May-2014 18:36:13 GMT; path=/; domain=.flickr.com
|
23
|
-
cache-control:
|
24
|
-
- private
|
25
|
-
x-served-by:
|
26
|
-
- www150.flickr.mud.yahoo.com
|
27
|
-
vary:
|
28
|
-
- Accept-Encoding
|
29
|
-
content-type:
|
30
|
-
- text/plain;charset=UTF-8
|
31
|
-
age:
|
32
|
-
- "0"
|
33
|
-
via:
|
34
|
-
- HTTP/1.1 r39.ycpi.mud.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ]), HTTP/1.1 r12.ycpi.ams.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ])
|
35
|
-
server:
|
36
|
-
- YTS/1.20.16
|
37
|
-
connection:
|
38
|
-
- close
|
39
|
-
body:
|
40
|
-
encoding: ASCII-8BIT
|
41
|
-
string: oauth_problem=consumer_key_unknown
|
42
|
-
http_version:
|
43
|
-
recorded_at: Tue, 15 May 2012 18:36:13 GMT
|
44
|
-
- request:
|
45
|
-
method: get
|
46
|
-
uri: http://www.flickr.com/services/oauth/request_token?oauth_callback=oob
|
47
|
-
body:
|
48
|
-
encoding: US-ASCII
|
49
|
-
string: ""
|
50
|
-
headers:
|
51
|
-
Authorization:
|
52
|
-
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="74d7fa04db335e2937437ae76ee1f0d7", oauth_signature="FLbia4X%2FI%2B2YNi2JOImB1aUzCiU%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106973", oauth_version="1.0"
|
53
|
-
response:
|
54
|
-
status:
|
55
|
-
code: 401
|
56
|
-
message:
|
57
|
-
headers:
|
58
|
-
date:
|
59
|
-
- Tue, 15 May 2012 18:36:13 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
|
-
set-cookie:
|
63
|
-
- localization=en-us%3Bus%3Bus; expires=Tue, 13-May-2014 18:36:13 GMT; path=/; domain=.flickr.com
|
64
|
-
cache-control:
|
65
|
-
- private
|
66
|
-
x-served-by:
|
67
|
-
- www43.flickr.mud.yahoo.com
|
68
|
-
vary:
|
69
|
-
- Accept-Encoding
|
70
|
-
content-type:
|
71
|
-
- text/plain;charset=UTF-8
|
72
|
-
age:
|
73
|
-
- "0"
|
74
|
-
via:
|
75
|
-
- HTTP/1.1 r41.ycpi.mud.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ]), HTTP/1.1 r17.ycpi.ams.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ])
|
76
|
-
server:
|
77
|
-
- YTS/1.20.16
|
78
|
-
connection:
|
79
|
-
- close
|
80
|
-
body:
|
81
|
-
encoding: ASCII-8BIT
|
82
|
-
string: oauth_problem=signature_invalid&debug_sbs=GET&http%3A%2F%2Fwww.flickr.com%2Fservices%2Foauth%2Frequest_token&oauth_callback%3Doob%26oauth_consumer_key%3DAPI_KEY%26oauth_nonce%3D74d7fa04db335e2937437ae76ee1f0d7%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1337106973%26oauth_version%3D1.0
|
83
|
-
http_version:
|
84
|
-
recorded_at: Tue, 15 May 2012 18:36:13 GMT
|
85
|
-
- request:
|
86
|
-
method: get
|
87
|
-
uri: http://www.flickr.com/services/oauth/request_token?oauth_callback=oob
|
88
|
-
body:
|
89
|
-
encoding: US-ASCII
|
90
|
-
string: ""
|
91
|
-
headers:
|
92
|
-
Authorization:
|
93
|
-
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="f281211235ee00e5e804b0bced07db86", oauth_signature="FEFxXucnkU1vqcapGXSmFFQV3RA%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106973", oauth_version="1.0"
|
94
|
-
response:
|
95
|
-
status:
|
96
|
-
code: 200
|
97
|
-
message:
|
98
|
-
headers:
|
99
|
-
date:
|
100
|
-
- Tue, 15 May 2012 18:36:13 GMT
|
101
|
-
p3p:
|
102
|
-
- 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"
|
103
|
-
set-cookie:
|
104
|
-
- localization=en-us%3Bus%3Bus; expires=Tue, 13-May-2014 18:36:14 GMT; path=/; domain=.flickr.com
|
105
|
-
cache-control:
|
106
|
-
- private
|
107
|
-
x-served-by:
|
108
|
-
- www197.flickr.mud.yahoo.com
|
109
|
-
vary:
|
110
|
-
- Accept-Encoding
|
111
|
-
content-type:
|
112
|
-
- text/plain;charset=UTF-8
|
113
|
-
age:
|
114
|
-
- "3"
|
115
|
-
via:
|
116
|
-
- HTTP/1.1 r27.ycpi.mud.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ]), HTTP/1.1 r08.ycpi.ams.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ])
|
117
|
-
server:
|
118
|
-
- YTS/1.20.16
|
119
|
-
connection:
|
120
|
-
- close
|
121
|
-
body:
|
122
|
-
encoding: ASCII-8BIT
|
123
|
-
string: oauth_callback_confirmed=true&oauth_token=72157629743800246-00b99df825d26ba8&oauth_token_secret=c196d84eb9991116
|
124
|
-
http_version:
|
125
|
-
recorded_at: Tue, 15 May 2012 18:36:14 GMT
|
126
|
-
- request:
|
127
|
-
method: get
|
128
|
-
uri: http://www.flickr.com/services/oauth/access_token?oauth_verifier=foo
|
129
|
-
body:
|
130
|
-
encoding: US-ASCII
|
131
|
-
string: ""
|
132
|
-
headers:
|
133
|
-
Authorization:
|
134
|
-
- OAuth oauth_consumer_key="API_KEY", oauth_nonce="269c50cc0bb64d4d1a6278ba0fd444a5", oauth_signature="%2FjkXnUp9knnhzs9zhRCmUM8%2FLJo%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1337106974", oauth_token="72157629743800246-00b99df825d26ba8", oauth_version="1.0"
|
135
|
-
response:
|
136
|
-
status:
|
137
|
-
code: 401
|
138
|
-
message:
|
139
|
-
headers:
|
140
|
-
date:
|
141
|
-
- Tue, 15 May 2012 18:36:15 GMT
|
142
|
-
p3p:
|
143
|
-
- 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"
|
144
|
-
set-cookie:
|
145
|
-
- localization=en-us%3Bus%3Bus; expires=Tue, 13-May-2014 18:36:15 GMT; path=/; domain=.flickr.com
|
146
|
-
cache-control:
|
147
|
-
- private
|
148
|
-
x-served-by:
|
149
|
-
- www111.flickr.mud.yahoo.com
|
150
|
-
vary:
|
151
|
-
- Accept-Encoding
|
152
|
-
content-type:
|
153
|
-
- text/plain;charset=UTF-8
|
154
|
-
age:
|
155
|
-
- "0"
|
156
|
-
via:
|
157
|
-
- HTTP/1.1 r23.ycpi.mud.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ]), HTTP/1.1 r10.ycpi.ukl.yahoo.net (YahooTrafficServer/1.20.16 [cMsSf ])
|
158
|
-
server:
|
159
|
-
- YTS/1.20.16
|
160
|
-
connection:
|
161
|
-
- close
|
162
|
-
body:
|
163
|
-
encoding: ASCII-8BIT
|
164
|
-
string: oauth_problem=token_rejected
|
165
|
-
http_version:
|
166
|
-
recorded_at: Tue, 15 May 2012 18:36:15 GMT
|
167
|
-
recorded_with: VCR 2.1.1
|
data/spec/oauth_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
|
2
|
-
|
3
|
-
describe Flickrie::OAuth do
|
4
|
-
context "incorrect credentials" do
|
5
|
-
it "should raise exceptions", :vcr do
|
6
|
-
Flickrie.api_key = "foo"
|
7
|
-
Flickrie.shared_secret = "foo"
|
8
|
-
|
9
|
-
expect { Flickrie::OAuth.get_request_token }.
|
10
|
-
to raise_error(Flickrie::OAuth::Error)
|
11
|
-
|
12
|
-
Flickrie.api_key = ENV['FLICKR_API_KEY']
|
13
|
-
expect { Flickrie::OAuth.get_request_token }.
|
14
|
-
to raise_error(Flickrie::OAuth::Error)
|
15
|
-
|
16
|
-
Flickrie.shared_secret = ENV['FLICKR_SHARED_SECRET']
|
17
|
-
request_token = Flickrie::OAuth.get_request_token
|
18
|
-
expect { Flickrie::OAuth.get_access_token("foo", request_token) }.
|
19
|
-
to raise_error(Flickrie::OAuth::Error)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/spec/user_spec.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
|
3
|
-
|
4
|
-
describe Flickrie::User do
|
5
|
-
context "get info" do
|
6
|
-
it "should have all attributes correctly set", :vcr do
|
7
|
-
[
|
8
|
-
Flickrie.get_user_info(USER_NSID),
|
9
|
-
Flickrie::User.public_new('nsid' => USER_NSID).get_info
|
10
|
-
].
|
11
|
-
each do |user|
|
12
|
-
user.id.should eq(USER_NSID)
|
13
|
-
user.nsid.should eq(USER_NSID)
|
14
|
-
user.username.should eq('Janko Marohnić')
|
15
|
-
user.real_name.should eq('Janko Marohnić')
|
16
|
-
user.location.should eq('Zagreb, Croatia')
|
17
|
-
user.time_zone['label'].should eq('Sarajevo, Skopje, Warsaw, Zagreb')
|
18
|
-
user.time_zone['offset'].should eq('+01:00')
|
19
|
-
description = "I'm a programmer, and I'm gonna program a badass Ruby library for Flickr."
|
20
|
-
user.description.should eq(description)
|
21
|
-
|
22
|
-
user.profile_url.should_not be_empty
|
23
|
-
user.mobile_url.should_not be_empty
|
24
|
-
user.photos_url.should_not be_empty
|
25
|
-
|
26
|
-
user.icon_server.should eq('5464')
|
27
|
-
user.icon_farm.should eq(6)
|
28
|
-
user.buddy_icon_url.should_not be_empty
|
29
|
-
|
30
|
-
user.pro?.should be_false
|
31
|
-
|
32
|
-
user.first_taken.should be_an_instance_of(Time)
|
33
|
-
user.first_uploaded.should be_an_instance_of(Time)
|
34
|
-
|
35
|
-
user.media_count.should eq(98)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context "find by username or email" do
|
41
|
-
it "should have all attributes correctly set", :vcr do
|
42
|
-
[
|
43
|
-
Flickrie.find_user_by_username('Janko Marohnić'),
|
44
|
-
Flickrie.find_user_by_email('janko.marohnic@gmail.com')
|
45
|
-
].
|
46
|
-
each do |user|
|
47
|
-
user.id.should eq(USER_NSID)
|
48
|
-
user.nsid.should eq(USER_NSID)
|
49
|
-
user.username.should eq('Janko Marohnić')
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|