kinja 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kinja/client.rb +8 -2
- data/lib/kinja/helpers.rb +3 -2
- data/lib/kinja/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/api-token-test.yml +83 -28
- data/spec/fixtures/vcr_cassettes/get_author_default_blog_id.yml +13 -25
- data/spec/fixtures/vcr_cassettes/get_author_profile.yml +12 -24
- data/spec/fixtures/vcr_cassettes/get_post.yml +218 -210
- data/spec/fixtures/vcr_cassettes/login.yml +30 -40
- data/spec/fixtures/vcr_cassettes/update-post.yml +54 -56
- data/spec/fixtures/vcr_cassettes/write-post.yml +83 -102
- data/spec/lib/kinja/post_spec.rb +1 -1
- data/spec/lib/kinja_spec.rb +2 -2
- metadata +2 -4
- data/spec/fixtures/vcr_cassettes/author-path-er.yml +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c1365488768a90ad365de8c792729b83b46dc62
|
4
|
+
data.tar.gz: 483808eb1f3462b8703c62bfbcaef14fa5eca9e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04a5b1c4b3189396ba00ac2fc3e6c00e7b6199b5f399be5827980616d8c82f98d72069855496b77d2dc0d7d727710910f8070ad7be9e4b0d6a5f8b0f8866f8e
|
7
|
+
data.tar.gz: 23c7eb3454ef57f12ac77b2ae2c601406b8b0d3e94ab870f6ec49c4543beb85e0b29c4fb6ba1229f6eb92885ec901524acc33888ae73a0194604f919ec389ad0
|
data/lib/kinja/client.rb
CHANGED
@@ -22,13 +22,19 @@ module Kinja
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def login
|
25
|
-
response = HTTParty.
|
25
|
+
response = HTTParty.post("#{API_ROOT}#{LOGIN_PATH}",
|
26
|
+
body: {
|
27
|
+
screenName: URI.encode(@username),
|
28
|
+
token: @pass
|
29
|
+
}.to_json,
|
30
|
+
headers: { 'Content-Type' => 'application/json' }
|
31
|
+
)
|
26
32
|
@user = response["data"]
|
27
33
|
response
|
28
34
|
end
|
29
35
|
|
30
36
|
def get_api_token(response)
|
31
|
-
@api_token = HTTParty.
|
37
|
+
@api_token = HTTParty.post("#{API_ROOT}#{TOKEN_PATH}",
|
32
38
|
cookies: {KinjaSession: session_token(response)}
|
33
39
|
)['data']['token']
|
34
40
|
end
|
data/lib/kinja/helpers.rb
CHANGED
@@ -10,8 +10,9 @@ module Kinja
|
|
10
10
|
|
11
11
|
private
|
12
12
|
API_ROOT = "http://kinja.com/api"
|
13
|
-
LOGIN_PATH = "/profile/account/burner/login"
|
14
|
-
|
13
|
+
# LOGIN_PATH = "/profile/account/burner/login"
|
14
|
+
LOGIN_PATH = "/profile/session/burnerLogin"
|
15
|
+
TOKEN_PATH = "/profile/token/create"
|
15
16
|
CREATE_POST_PATH = "/core/post/add"
|
16
17
|
POST_PATH = "core/post"
|
17
18
|
BLOG_PATH = "core/blog"
|
data/lib/kinja/version.rb
CHANGED
@@ -1,66 +1,121 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
|
-
method:
|
5
|
-
uri: http://kinja.com/api/profile/
|
4
|
+
method: post
|
5
|
+
uri: http://kinja.com/api/profile/session/burnerLogin
|
6
6
|
body:
|
7
|
-
encoding:
|
8
|
-
string: ''
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"screenName":"gemtest","token":"mzjjk judly bjysk ujnbv"}'
|
9
9
|
headers:
|
10
|
-
|
11
|
-
-
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
12
|
response:
|
13
13
|
status:
|
14
14
|
code: 200
|
15
15
|
message: OK
|
16
16
|
headers:
|
17
|
-
Access-Control-Allow-Origin:
|
18
|
-
- "*"
|
19
|
-
Access-Control-Allow-Headers:
|
20
|
-
- Content-Type
|
21
|
-
X-Kinja-Version:
|
22
|
-
- '20141118'
|
23
|
-
Access-Control-Allow-Methods:
|
24
|
-
- POST, GET, OPTIONS, PUT, DELETE
|
25
17
|
Cache-Control:
|
26
18
|
- no-cache, no-store, private
|
27
|
-
P3p:
|
28
|
-
- CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
|
29
19
|
Content-Type:
|
30
20
|
- application/json; charset=utf-8
|
21
|
+
P3p:
|
22
|
+
- CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
|
23
|
+
Set-Cookie:
|
24
|
+
- KinjaBurner="d41d8cd98f00b204e9800998ecf8427e|mzjjk judly bjysk ujnbv"; Expires=Mon,
|
25
|
+
21 Jul 2025 16:01:37 GMT; Path=/; HTTPOnly
|
26
|
+
- KinjaRememberMe=5876237249235511023|3c47d1e2-6772-4366-9d8b-9ff92ba701af;
|
27
|
+
Expires=Mon, 21 Jul 2025 16:01:37 GMT; Path=/; HTTPOnly
|
28
|
+
- KinjaSession=3c47d1e2-6772-4366-9d8b-9ff92ba701af; Expires=Fri, 31 Jul 2015
|
29
|
+
16:01:37 GMT; Path=/; HTTPOnly
|
30
|
+
- geocc=US;path=/;
|
31
|
+
X-Kinja:
|
32
|
+
- 'app05.xyz.kinja-ops.com #1445'
|
33
|
+
X-Kinja-Version:
|
34
|
+
- '20141118'
|
31
35
|
X-Robots-Tag:
|
32
36
|
- noindex
|
37
|
+
X-Cdn-Fetch:
|
38
|
+
- mantle-setcookie
|
39
|
+
Content-Length:
|
40
|
+
- '332'
|
41
|
+
Accept-Ranges:
|
42
|
+
- bytes
|
43
|
+
Date:
|
44
|
+
- Fri, 24 Jul 2015 16:01:37 GMT
|
45
|
+
Via:
|
46
|
+
- 1.1 varnish
|
47
|
+
Connection:
|
48
|
+
- keep-alive
|
49
|
+
X-Served-By:
|
50
|
+
- cache-jfk1034-JFK
|
51
|
+
X-Cache:
|
52
|
+
- MISS
|
53
|
+
X-Cache-Hits:
|
54
|
+
- '0'
|
55
|
+
X-Timer:
|
56
|
+
- S1437753697.608116,VS0,VE58
|
57
|
+
Vary:
|
58
|
+
- X-Feature-Hash
|
59
|
+
body:
|
60
|
+
encoding: UTF-8
|
61
|
+
string: '{"meta":{"error":null,"warnings":[]},"data":{"id":"5876237249235511023","screenName":"gemtest","displayName":"gemtest","authType":4,"authName":"burner","createdMillis":1424733492000,"updatedMillis":1437753697655,"lastLoginMillis":1437753697655,"status":"enabled","avatar":{"id":"17jcxk0ml1k8qpng","format":"png"},"superUser":false}}'
|
62
|
+
http_version:
|
63
|
+
recorded_at: Fri, 24 Jul 2015 16:01:37 GMT
|
64
|
+
- request:
|
65
|
+
method: post
|
66
|
+
uri: http://kinja.com/api/profile/token/create
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: ''
|
70
|
+
headers:
|
71
|
+
Cookie:
|
72
|
+
- KinjaSession=3c47d1e2-6772-4366-9d8b-9ff92ba701af
|
73
|
+
response:
|
74
|
+
status:
|
75
|
+
code: 200
|
76
|
+
message: OK
|
77
|
+
headers:
|
78
|
+
Cache-Control:
|
79
|
+
- no-cache, no-store, private
|
80
|
+
Content-Type:
|
81
|
+
- application/json; charset=utf-8
|
82
|
+
P3p:
|
83
|
+
- CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
|
33
84
|
Set-Cookie:
|
34
|
-
- KinjaSession=
|
35
|
-
|
85
|
+
- KinjaSession=3c47d1e2-6772-4366-9d8b-9ff92ba701af; Expires=Fri, 31 Jul 2015
|
86
|
+
16:01:37 GMT; Path=/; HTTPOnly
|
36
87
|
- geocc=US;path=/;
|
37
88
|
X-Kinja:
|
38
|
-
- '
|
89
|
+
- 'app06.bfc.kinja-ops.com #1445'
|
90
|
+
X-Kinja-Version:
|
91
|
+
- '20141118'
|
92
|
+
X-Robots-Tag:
|
93
|
+
- noindex
|
94
|
+
X-Cdn-Fetch:
|
95
|
+
- mantle-setcookie
|
39
96
|
Content-Length:
|
40
|
-
- '
|
97
|
+
- '181'
|
41
98
|
Accept-Ranges:
|
42
|
-
-
|
99
|
+
- bytes
|
43
100
|
Date:
|
44
|
-
-
|
101
|
+
- Fri, 24 Jul 2015 16:01:37 GMT
|
45
102
|
Via:
|
46
103
|
- 1.1 varnish
|
47
|
-
Age:
|
48
|
-
- '0'
|
49
104
|
Connection:
|
50
105
|
- keep-alive
|
51
106
|
X-Served-By:
|
52
|
-
- cache-
|
107
|
+
- cache-jfk1021-JFK
|
53
108
|
X-Cache:
|
54
109
|
- MISS
|
55
110
|
X-Cache-Hits:
|
56
111
|
- '0'
|
57
112
|
X-Timer:
|
58
|
-
-
|
113
|
+
- S1437753697.706217,VS0,VE53
|
59
114
|
Vary:
|
60
115
|
- X-Feature-Hash
|
61
116
|
body:
|
62
117
|
encoding: UTF-8
|
63
|
-
string: '{"meta":{"error":null,"warnings":[]},"data":{"token":"
|
118
|
+
string: '{"meta":{"error":null,"warnings":[]},"data":{"token":"d4e084be-77ed-4bc6-ab0d-248a5f047df8-0-d367eb4abb79931841acb749fe64012f9a4f0d1d","secure":false,"createdMillis":1437753697751}}'
|
64
119
|
http_version:
|
65
|
-
recorded_at:
|
120
|
+
recorded_at: Fri, 24 Jul 2015 16:01:37 GMT
|
66
121
|
recorded_with: VCR 2.9.3
|
@@ -6,28 +6,16 @@ http_interactions:
|
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- "*/*"
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
9
|
+
headers: {}
|
16
10
|
response:
|
17
11
|
status:
|
18
12
|
code: 200
|
19
13
|
message: OK
|
20
14
|
headers:
|
21
|
-
Access-Control-Allow-Headers:
|
22
|
-
- Content-Type
|
23
|
-
Access-Control-Allow-Methods:
|
24
|
-
- POST, GET, OPTIONS, PUT, DELETE
|
25
|
-
Access-Control-Allow-Origin:
|
26
|
-
- "*"
|
27
15
|
Content-Type:
|
28
16
|
- application/json; charset=utf-8
|
29
17
|
X-Kinja:
|
30
|
-
- '
|
18
|
+
- 'app01.bfc.kinja-ops.com #1445'
|
31
19
|
X-Kinja-Version:
|
32
20
|
- '20141118'
|
33
21
|
X-Robots-Tag:
|
@@ -35,33 +23,33 @@ http_interactions:
|
|
35
23
|
X-Cdn-Fetch:
|
36
24
|
- mantle-origin-cache
|
37
25
|
Content-Length:
|
38
|
-
- '
|
26
|
+
- '217'
|
39
27
|
Accept-Ranges:
|
40
|
-
-
|
28
|
+
- bytes
|
41
29
|
Date:
|
42
|
-
-
|
30
|
+
- Fri, 24 Jul 2015 16:06:50 GMT
|
43
31
|
Via:
|
44
32
|
- 1.1 varnish
|
45
33
|
Age:
|
46
|
-
- '
|
34
|
+
- '0'
|
47
35
|
Connection:
|
48
36
|
- keep-alive
|
49
37
|
X-Served-By:
|
50
|
-
- cache-
|
38
|
+
- cache-jfk1033-JFK
|
51
39
|
X-Cache:
|
52
|
-
-
|
40
|
+
- MISS
|
53
41
|
X-Cache-Hits:
|
54
|
-
- '
|
42
|
+
- '0'
|
55
43
|
X-Timer:
|
56
|
-
-
|
44
|
+
- S1437754010.610402,VS0,VE3
|
57
45
|
Vary:
|
58
|
-
- X-Feature-Hash
|
46
|
+
- X-Feature-Hash
|
59
47
|
Set-Cookie:
|
60
48
|
- geocc=US;path=/;
|
61
49
|
body:
|
62
|
-
encoding:
|
50
|
+
encoding: UTF-8
|
63
51
|
string: '{"meta":{"error":null,"warnings":[]},"data":[{"id":"5716491910670767033","screenName":"adampash","displayName":"Adam
|
64
52
|
Pash","superUser":false,"defaultBlogId":771,"avatar":{"id":"gdjxua361big4hslpfhx","format":"png"}}]}'
|
65
53
|
http_version:
|
66
|
-
recorded_at:
|
54
|
+
recorded_at: Fri, 24 Jul 2015 16:06:50 GMT
|
67
55
|
recorded_with: VCR 2.9.3
|
@@ -6,28 +6,16 @@ http_interactions:
|
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- "*/*"
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
9
|
+
headers: {}
|
16
10
|
response:
|
17
11
|
status:
|
18
12
|
code: 200
|
19
13
|
message: OK
|
20
14
|
headers:
|
21
|
-
Access-Control-Allow-Headers:
|
22
|
-
- Content-Type
|
23
|
-
Access-Control-Allow-Methods:
|
24
|
-
- POST, GET, OPTIONS, PUT, DELETE
|
25
|
-
Access-Control-Allow-Origin:
|
26
|
-
- "*"
|
27
15
|
Content-Type:
|
28
16
|
- application/json; charset=utf-8
|
29
17
|
X-Kinja:
|
30
|
-
- '
|
18
|
+
- 'app01.bfc.kinja-ops.com #1445'
|
31
19
|
X-Kinja-Version:
|
32
20
|
- '20141118'
|
33
21
|
X-Robots-Tag:
|
@@ -35,11 +23,11 @@ http_interactions:
|
|
35
23
|
X-Cdn-Fetch:
|
36
24
|
- mantle-origin-cache
|
37
25
|
Content-Length:
|
38
|
-
- '
|
26
|
+
- '217'
|
39
27
|
Accept-Ranges:
|
40
|
-
-
|
28
|
+
- bytes
|
41
29
|
Date:
|
42
|
-
-
|
30
|
+
- Fri, 24 Jul 2015 16:06:50 GMT
|
43
31
|
Via:
|
44
32
|
- 1.1 varnish
|
45
33
|
Age:
|
@@ -47,21 +35,21 @@ http_interactions:
|
|
47
35
|
Connection:
|
48
36
|
- keep-alive
|
49
37
|
X-Served-By:
|
50
|
-
- cache-
|
38
|
+
- cache-jfk1023-JFK
|
51
39
|
X-Cache:
|
52
|
-
-
|
40
|
+
- HIT
|
53
41
|
X-Cache-Hits:
|
54
|
-
- '
|
42
|
+
- '1'
|
55
43
|
X-Timer:
|
56
|
-
-
|
44
|
+
- S1437754010.656395,VS0,VE0
|
57
45
|
Vary:
|
58
|
-
- X-Feature-Hash
|
46
|
+
- X-Feature-Hash
|
59
47
|
Set-Cookie:
|
60
48
|
- geocc=US;path=/;
|
61
49
|
body:
|
62
|
-
encoding:
|
50
|
+
encoding: UTF-8
|
63
51
|
string: '{"meta":{"error":null,"warnings":[]},"data":[{"id":"5716491910670767033","screenName":"adampash","displayName":"Adam
|
64
52
|
Pash","superUser":false,"defaultBlogId":771,"avatar":{"id":"gdjxua361big4hslpfhx","format":"png"}}]}'
|
65
53
|
http_version:
|
66
|
-
recorded_at:
|
54
|
+
recorded_at: Fri, 24 Jul 2015 16:06:50 GMT
|
67
55
|
recorded_with: VCR 2.9.3
|