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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eedfe0e20c91f7cc9d6024f5e68999fd3a505f5
4
- data.tar.gz: 67b344d053b98c65acfdda0511f117d2d1892104
3
+ metadata.gz: 92706b43ac357692771503d1b178c04dbf70e04d
4
+ data.tar.gz: 309fcc5e23e813a10bf94ddab5fd9a91c5f8c509
5
5
  SHA512:
6
- metadata.gz: 9bacffb41d03808b5301cfe783018c649a8e65f4c7e6d630f143744df6b7c06f68e9f87d9e062ad467993bebfda66ceb76cd909da446b10ffddb182ce3fba3dd
7
- data.tar.gz: 278c7a2b41e43487a833457e4ce77de072d912ede25b8fc80d8f7e0d5e7e6134ec0a852d825a4c730ad0a5ef29ed209158a40e87a766564a6b4dfbf8eb6ec905
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
- ## Todo
47
- * Build out other common REST endpoints
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] || true
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: { 'Content-Type' => 'application/json' }
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
@@ -1,3 +1,3 @@
1
1
  module Kinja
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -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
- 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
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
@@ -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: '<p>[<a data-attr="http://gawker.com/no-playlist-1685415865" href="http://gawker.com/no-playlist-1685415865">Gawker</a>]</p>',
34
- status: 'PUBLISHED',
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
@@ -4,7 +4,7 @@ RSpec.configure do |c|
4
4
  end
5
5
 
6
6
  require 'dotenv'
7
- ENV = Dotenv.load unless ENV
7
+ ENV = Dotenv.load
8
8
 
9
9
  require 'vcr'
10
10
  VCR.configure do |config|
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.18
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: 2016-11-17 00:00:00.000000000 Z
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