kinja 0.0.15 → 0.0.16
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/author.rb +0 -30
- data/lib/kinja/version.rb +1 -1
- data/spec/lib/kinja/author_spec.rb +1 -2
- metadata +1 -2
- data/sam.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 445ef6ba7016a4a114e098b6df6436f46b419623
|
4
|
+
data.tar.gz: 4d62271074314726a21a80aa3865f0337a6e5996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cecc77018ba70ecfb054bfd3ed55eeb192e0005e0850806fc303c7969e4e5fbd0c5c97f8a9771c7027ef6ae0717747ed6b3effea762ee1fb0de72263cad6fc84
|
7
|
+
data.tar.gz: 4bf1ee9340e314a94ef59152f8a5a3f4706c11edf9e25da2c525ad7cb2865d388e02c9a1fba6e4bcdeb24f4118a16693dbe9b9689b4909d9a18f2a28c74e5fe0
|
data/lib/kinja/author.rb
CHANGED
@@ -23,7 +23,6 @@ module Kinja
|
|
23
23
|
posts = posts.flatten
|
24
24
|
|
25
25
|
break if feed["pagination"]["next"].nil?
|
26
|
-
break if posts.length > 100
|
27
26
|
next_one = feed["pagination"]["next"]["startTime"]
|
28
27
|
puts posts.length
|
29
28
|
puts "Getting next one #{next_one}"
|
@@ -36,32 +35,3 @@ module Kinja
|
|
36
35
|
end
|
37
36
|
end
|
38
37
|
end
|
39
|
-
|
40
|
-
#
|
41
|
-
#
|
42
|
-
# def all_in_tag(name, blog=nil)
|
43
|
-
# posts = []
|
44
|
-
# feed = get_posts_in_tag(name)
|
45
|
-
# posts.push feed["data"]["items"]
|
46
|
-
# next_one = feed["data"]["pagination"]["next"]["startTime"]
|
47
|
-
# loop do
|
48
|
-
# if blog.nil?
|
49
|
-
# feed = get_posts_in_tag(
|
50
|
-
# name,
|
51
|
-
# "?startTime=#{next_one}"
|
52
|
-
# )
|
53
|
-
# puts next_one
|
54
|
-
# else
|
55
|
-
# feed = get_posts_in_tag_for_site(name, blog)
|
56
|
-
# end
|
57
|
-
# if feed["meta"]["success"]
|
58
|
-
# posts.push feed["data"]["items"]
|
59
|
-
# else
|
60
|
-
# feed
|
61
|
-
# end
|
62
|
-
# # require 'pry'; binding.pry
|
63
|
-
# break if feed["data"]["pagination"]["next"].nil?
|
64
|
-
# next_one = feed["data"]["pagination"]["next"]["startTime"]
|
65
|
-
# end
|
66
|
-
# posts.flatten
|
67
|
-
# end
|
data/lib/kinja/version.rb
CHANGED
@@ -41,11 +41,10 @@ describe Kinja::Author do
|
|
41
41
|
it "gets all posts and calculates page views" do
|
42
42
|
id = kinja.get_author_id("sambiddle")
|
43
43
|
posts = kinja.get_all_author_posts(id)
|
44
|
-
|
44
|
+
posts.map do |post|
|
45
45
|
puts post["post"]["id"]
|
46
46
|
post["post"]["id"]
|
47
47
|
end
|
48
|
-
require 'pry'; binding.pry
|
49
48
|
end
|
50
49
|
|
51
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Pash
|
@@ -161,7 +161,6 @@ files:
|
|
161
161
|
- lib/kinja/post.rb
|
162
162
|
- lib/kinja/tag.rb
|
163
163
|
- lib/kinja/version.rb
|
164
|
-
- sam.rb
|
165
164
|
- spec/fixtures/vcr_cassettes/api-token-test.yml
|
166
165
|
- spec/fixtures/vcr_cassettes/get_author_default_blog_id.yml
|
167
166
|
- spec/fixtures/vcr_cassettes/get_author_id.yml
|
data/sam.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'kinja'
|
2
|
-
|
3
|
-
module Counts
|
4
|
-
def self.author(name)
|
5
|
-
kinja = Kinja.new
|
6
|
-
id = kinja.get_author_id(name)
|
7
|
-
posts = kinja.get_all_author_posts(id)
|
8
|
-
post_ids = posts.map do |post|
|
9
|
-
puts post["post"]["id"]
|
10
|
-
post["post"]["id"]
|
11
|
-
end
|
12
|
-
counts = post_ids.map do |id|
|
13
|
-
kinja.get_counts(id)["views"]
|
14
|
-
end
|
15
|
-
|
16
|
-
total = counts.reduce(:+)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
total = Counts.author("sambiddle")
|
21
|
-
|
22
|
-
puts total
|