kinja 0.0.18 → 0.0.19
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/README.md +5 -2
- data/lib/kinja/post.rb +6 -2
- data/lib/kinja/version.rb +1 -1
- data/spec/lib/kinja/author_spec.rb +8 -8
- data/spec/lib/kinja/post_spec.rb +6 -5
- data/spec/spec_helper.rb +1 -1
- metadata +2 -3
- data/kinja-0.0.17.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92706b43ac357692771503d1b178c04dbf70e04d
|
4
|
+
data.tar.gz: 309fcc5e23e813a10bf94ddab5fd9a91c5f8c509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e43619907193cfd4fee8af9b6d19c3066c8ec606df9f591ff578c0ab07f5d531395ae0218c16903ac903b02ea86b21b4c75acd0dd763a9dcbe5149c0cc84e4d
|
7
|
+
data.tar.gz: b41c5a962e0f88f4f8f7fd0ad3634ac6bd155eafafb9071cb0028f84e5c66bb24e96b1f98184003b85f808872a89adad6f634a11882016f4707556d7b18d771e
|
data/README.md
CHANGED
@@ -43,8 +43,11 @@ post = client.get_post("http://gawker.com/lapd-claims-the-jinx-had-nothing-to-do
|
|
43
43
|
post = client.get_post("1691730232")
|
44
44
|
```
|
45
45
|
|
46
|
-
##
|
47
|
-
|
46
|
+
## Publishing update
|
47
|
+
|
48
|
+
1. Bump version in version.rb
|
49
|
+
1. `rake build`
|
50
|
+
1. `rake release`
|
48
51
|
|
49
52
|
## Contributing
|
50
53
|
|
data/lib/kinja/post.rb
CHANGED
@@ -8,9 +8,10 @@ module Kinja
|
|
8
8
|
def create_post(opts={})
|
9
9
|
get_api_token(login)
|
10
10
|
opts[:status] = opts[:status] || "DRAFT"
|
11
|
-
opts[:replies] = opts[:replies] ||
|
11
|
+
opts[:replies] = opts[:replies] || false
|
12
12
|
opts[:defaultBlogId] = opts[:defaultBlogId] || get_default_blog_id(@user)
|
13
13
|
|
14
|
+
puts opts
|
14
15
|
HTTParty.post create_post_path,
|
15
16
|
body: {
|
16
17
|
headline: opts[:headline],
|
@@ -20,7 +21,10 @@ module Kinja
|
|
20
21
|
allowReplies: opts[:replies],
|
21
22
|
tags: []
|
22
23
|
}.to_json,
|
23
|
-
headers: {
|
24
|
+
headers: {
|
25
|
+
'content-type' => 'application/json',
|
26
|
+
'token' => @api_token
|
27
|
+
}
|
24
28
|
end
|
25
29
|
|
26
30
|
def update_post(link_or_id, opts)
|
data/lib/kinja/version.rb
CHANGED
@@ -38,13 +38,13 @@ describe Kinja::Author do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
it "gets all posts and calculates page views" do
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
41
|
+
# it "gets all posts and calculates page views" do
|
42
|
+
# id = kinja.get_author_id("sambiddle")
|
43
|
+
# posts = kinja.get_all_author_posts(id)
|
44
|
+
# posts.map do |post|
|
45
|
+
# puts post["post"]["id"]
|
46
|
+
# post["post"]["id"]
|
47
|
+
# end
|
48
|
+
# end
|
49
49
|
|
50
50
|
end
|
data/spec/lib/kinja/post_spec.rb
CHANGED
@@ -27,15 +27,16 @@ describe Kinja::Post do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "posts stuff" do
|
30
|
-
VCR.use_cassette('write-post') do
|
30
|
+
# VCR.use_cassette('write-post') do
|
31
31
|
post = kinja.create_post(
|
32
|
-
headline: '',
|
33
|
-
body:
|
34
|
-
status: '
|
32
|
+
headline: 'Test',
|
33
|
+
body: [{type:"Paragraph",value:[{type:"Text",value:"Begin forwarded message:",styles:[]}],containers:[]},{type:"Paragraph",value:[{type:"Text",value:"From: Gardiner Harris <xxx@nytimes.com<mailto:xxx@nytimes.com>>",styles:[]},{type:"LineBreak"},{type:"Text",value:"Date: November 15, 2016 at 11:08:05 AM GMT+2",styles:[]},{type:"LineBreak"},{type:"Text",value:"To: xxx@who.eop.gov<mailto:xxx@who.eop.gov>",styles:[]},{type:"LineBreak"},{type:"Text",value:"Subject: Motorcade moving; pool 3",styles:[]}],containers:[]},{type:"Paragraph",value:[{type:"Text",value:"The motorcade is rolling through blocked off highways and streets into",styles:[]},{type:"LineBreak"},{type:"Text",value:"central Athens, dry hillsides and occasional groves of olive trees and",styles:[]},{type:"LineBreak"},{type:"Text",value:"dry dock boatyards on either side.",styles:[]}],containers:[]},{type:"Paragraph",value:[{type:"Text",value:"Gardiner Harris",styles:[]},{type:"LineBreak"},{type:"Text",value:"White House Correspondent",styles:[]},{type:"LineBreak"},{type:"Text",value:"The New York Times",styles:[]},{type:"LineBreak"},{type:"Text",value:"1627 I Street NW",styles:[]},{type:"LineBreak"},{type:"Text",value:"Washington DC 20006",styles:[]},{type:"LineBreak"},{type:"Text",value:"Desk: +202-xxx-xxxx",styles:[]},{type:"LineBreak"},{type:"Text",value:"Cell: +202-xxx-xxxx",styles:[]},{type:"LineBreak"},{type:"Text",value:"xxx@nytimes.com<mailto:xxx@nytimes.com>",styles:[]}],containers:[]},{type:"Paragraph",value:[{type:"Text",value:"-----",styles:[]}],containers:[]},{type:"Paragraph",value:[{type:"Text",value:"Unsubscribe [ http://messages.whitehouse.gov/accounts/USEOPWHPO/subscriber/new?preferences=true ]",styles:[]}],containers:[]},{type:"Paragraph",value:[{type:"Text",value:"The White House · 1600 Pennsylvania Avenue, NW · Washington DC 20500 · 202-xxx-xxxx",styles:[]}],containers:[]},{style:"Line",containers:[],type:"HorizontalRule"},{containers:[],value:[{styles:["Italic"],value:"Public Pool is an automated feed of ",type:"Text"},{"reference":"http://politburo.kinja.com/here-are-all-the-white-house-pool-reports-1691913651",value:[{styles:["Italic"],value:"White House press pool reports",type:"Text"}],type:"Link"},{styles:["Italic"],value:". For live updates, follow ",type:"Text"},{"reference":"https://twitter.com/whpublicpool",value:[{styles:["Italic"],value:"@WHPublicPool",type:"Text"}],type:"Link"},{styles:["Italic"],value:" on Twitter.",type:"Text"}],type:"Paragraph"}],
|
34
|
+
status: 'DRAFT',
|
35
35
|
replies: false
|
36
36
|
)
|
37
|
+
puts post
|
37
38
|
expect(post.code).to be 200
|
38
|
-
end
|
39
|
+
# end
|
39
40
|
end
|
40
41
|
|
41
42
|
it "updates posts" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kinja
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Pash
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -150,7 +150,6 @@ files:
|
|
150
150
|
- LICENSE.txt
|
151
151
|
- README.md
|
152
152
|
- Rakefile
|
153
|
-
- kinja-0.0.17.gem
|
154
153
|
- kinja.gemspec
|
155
154
|
- kristin.txt
|
156
155
|
- lib/kinja.rb
|
data/kinja-0.0.17.gem
DELETED
Binary file
|