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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 929cb0064bc7276263dfb0e6335f75e9013083cc
4
- data.tar.gz: e52dce87590a124bdf44daba31d56d76a8b69299
3
+ metadata.gz: 2c1365488768a90ad365de8c792729b83b46dc62
4
+ data.tar.gz: 483808eb1f3462b8703c62bfbcaef14fa5eca9e3
5
5
  SHA512:
6
- metadata.gz: 941b4fa7229db1b53bd6893a279f87bac1976d5f8f90e42f292020151f94e77be061bdeec3e27db8ebc3725969eb4f0d4350def1708a6a34fa973ef1d15f8f66
7
- data.tar.gz: 4033b706869fb16c72e4be6d0b249737fe4a8ea4a4612527c9fbd541c41381cf1ea5ba530a0492b517878c594fdca89644c625ff689cb875bd02a22c7c26ee0f
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.get "#{API_ROOT}#{LOGIN_PATH}?screenName=#{URI.encode @username}&token=#{URI.encode @pass}"
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.get("#{API_ROOT}#{TOKEN_PATH}",
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
- TOKEN_PATH = "/profile/token"
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,3 +1,3 @@
1
1
  module Kinja
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -1,66 +1,121 @@
1
1
  ---
2
2
  http_interactions:
3
3
  - request:
4
- method: get
5
- uri: http://kinja.com/api/profile/token
4
+ method: post
5
+ uri: http://kinja.com/api/profile/session/burnerLogin
6
6
  body:
7
- encoding: US-ASCII
8
- string: ''
7
+ encoding: UTF-8
8
+ string: '{"screenName":"gemtest","token":"mzjjk judly bjysk ujnbv"}'
9
9
  headers:
10
- Cookie:
11
- - KinjaSession=a72c7535-20c9-447d-b22c-a502af7be233
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=a72c7535-20c9-447d-b22c-a502af7be233; Expires=Mon, 02 Mar 2015
35
- 23:19:02 GMT; Path=/; HTTPOnly
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
- - 'app04.bfc.kinja-ops.com #993'
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
- - '172'
97
+ - '181'
41
98
  Accept-Ranges:
42
- - none
99
+ - bytes
43
100
  Date:
44
- - Mon, 23 Feb 2015 23:19:02 GMT
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-jfk1031-JFK
107
+ - cache-jfk1021-JFK
53
108
  X-Cache:
54
109
  - MISS
55
110
  X-Cache-Hits:
56
111
  - '0'
57
112
  X-Timer:
58
- - S1424733542.342583,VS0,VE5
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":"78c7e184-d9da-4555-b8c3-f488e6a7a343","session":"a72c7535-20c9-447d-b22c-a502af7be233","createdMillis":1424733542346}}'
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: Mon, 23 Feb 2015 23:19:02 GMT
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
- - 'app05.xyz.kinja-ops.com #1178'
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
- - '188'
26
+ - '217'
39
27
  Accept-Ranges:
40
- - none
28
+ - bytes
41
29
  Date:
42
- - Tue, 14 Apr 2015 13:42:56 GMT
30
+ - Fri, 24 Jul 2015 16:06:50 GMT
43
31
  Via:
44
32
  - 1.1 varnish
45
33
  Age:
46
- - '5'
34
+ - '0'
47
35
  Connection:
48
36
  - keep-alive
49
37
  X-Served-By:
50
- - cache-jfk1024-JFK
38
+ - cache-jfk1033-JFK
51
39
  X-Cache:
52
- - HIT
40
+ - MISS
53
41
  X-Cache-Hits:
54
- - '1'
42
+ - '0'
55
43
  X-Timer:
56
- - S1429018976.317220,VS0,VE0
44
+ - S1437754010.610402,VS0,VE3
57
45
  Vary:
58
- - X-Feature-Hash,Accept-Encoding
46
+ - X-Feature-Hash
59
47
  Set-Cookie:
60
48
  - geocc=US;path=/;
61
49
  body:
62
- encoding: ASCII-8BIT
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: Tue, 14 Apr 2015 13:42:58 GMT
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
- - 'app14.xyz.kinja-ops.com #1178'
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
- - '188'
26
+ - '217'
39
27
  Accept-Ranges:
40
- - none
28
+ - bytes
41
29
  Date:
42
- - Mon, 13 Apr 2015 22:06:32 GMT
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-jfk1033-JFK
38
+ - cache-jfk1023-JFK
51
39
  X-Cache:
52
- - MISS
40
+ - HIT
53
41
  X-Cache-Hits:
54
- - '0'
42
+ - '1'
55
43
  X-Timer:
56
- - S1428962792.353481,VS0,VE8
44
+ - S1437754010.656395,VS0,VE0
57
45
  Vary:
58
- - X-Feature-Hash,Accept-Encoding
46
+ - X-Feature-Hash
59
47
  Set-Cookie:
60
48
  - geocc=US;path=/;
61
49
  body:
62
- encoding: ASCII-8BIT
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: Mon, 13 Apr 2015 22:06:35 GMT
54
+ recorded_at: Fri, 24 Jul 2015 16:06:50 GMT
67
55
  recorded_with: VCR 2.9.3