tumblr_draftking 0.9.1.0 → 0.10.0
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/CHANGELOG.md +3 -0
- data/README.md +2 -2
- data/bin/dk +7 -1
- data/lib/draftking/client.rb +3 -1
- data/lib/draftking/posts.rb +7 -2
- data/lib/draftking/posts/post.rb +6 -1
- data/lib/draftking/posts/posts_helpers.rb +1 -0
- data/lib/draftking/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6e41e4944fa26486bda43f3878307b7b400b67a
|
4
|
+
data.tar.gz: d5e11a2fcd4e12760460d75a9144b81c4a091796
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9457b1402c0e86adcd0078e1d158924e233885a7174e7875c7fc755736b9e69afde064e06464397611c2acf5fbce5f14097ce2dcf724eaabfe3bda76be6202e5
|
7
|
+
data.tar.gz: efae44606eba41deb21fd78ee9a5d05de205c2873fb67865cdae19861da5c36b23d7d650433b4ccda8eec0b8f8631eefb1974fdb956d14926648b24adab85377
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# Changelog :: tumblr_draftking
|
2
|
+
## Version 0.10.0
|
3
|
+
+ Enhanced get_posts logic to handle retrieval of published posts. Set `dk.source = DK::PUBLISH` before calling `dk.get_posts`.
|
4
|
+
|
2
5
|
## Version 0.9.1.0
|
3
6
|
+ Added CLI option (--no-show-pi) to hide progress indicators. (--mute) can still be used to silence progress messages and the final report.
|
4
7
|
|
data/README.md
CHANGED
@@ -15,8 +15,8 @@ DraftKing for Tumblr takes the hassle out of managing your draft queue!
|
|
15
15
|
+ **Randomize post order to add variety.**
|
16
16
|
+ **Manage multiple accounts.**
|
17
17
|
|
18
|
-
Version 0.
|
19
|
-
+
|
18
|
+
Version 0.10.0
|
19
|
+
+ Enhanced get_posts logic to handle retrieval of published posts. Set `dk.source = DK::PUBLISH` before calling `dk.get_posts`.
|
20
20
|
|
21
21
|
+ Please report any [issues] you encounter!
|
22
22
|
+ [Change Log](./CHANGELOG.md)
|
data/bin/dk
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rubygems'
|
3
|
-
|
3
|
+
if ENV['DEV_ENV']
|
4
|
+
# DEV ONLY - Run development source using system installed cli
|
5
|
+
rdir = ENV['DIR_RUBY']
|
6
|
+
require File.join(Dir.home, "#{rdir}/tumblr_draftking/lib/tumblr_draftking")
|
7
|
+
else
|
8
|
+
require_relative '../lib/tumblr_draftking'
|
9
|
+
end
|
4
10
|
|
5
11
|
# Display 'update available'
|
6
12
|
require 'open-uri'
|
data/lib/draftking/client.rb
CHANGED
@@ -14,7 +14,7 @@ module DK
|
|
14
14
|
attr_accessor :shuffle, :keep_tree, :test_data, :mute
|
15
15
|
attr_accessor :simulate, :keep_tags, :before_id, :credit
|
16
16
|
attr_accessor :message, :source, :auto_tag, :state
|
17
|
-
attr_accessor :type, :tags
|
17
|
+
attr_accessor :type, :tags, :greedy, :show_pi
|
18
18
|
|
19
19
|
# Initialize instance of DraftKing for the specified blog
|
20
20
|
# @param options[:blog_name] [String] Target blog name
|
@@ -87,6 +87,8 @@ module DK
|
|
87
87
|
return src if src.is_a? Symbol
|
88
88
|
return :dashboard if src.include?('dash')
|
89
89
|
return :queue if src.include?('queue')
|
90
|
+
return :posts if src.include?('publish')
|
91
|
+
return :draft if src.include?('draft')
|
90
92
|
end
|
91
93
|
end
|
92
94
|
end
|
data/lib/draftking/posts.rb
CHANGED
@@ -148,7 +148,7 @@ module DK
|
|
148
148
|
|
149
149
|
begin
|
150
150
|
retries ||= 0
|
151
|
-
result = call_source(options)
|
151
|
+
result = call_source(options)['posts']
|
152
152
|
result.is_a?(Integer) ? (raise TypeError) : result
|
153
153
|
rescue TypeError
|
154
154
|
(retries += 1) > MAX_RETRY ? [] : retry
|
@@ -158,7 +158,12 @@ module DK
|
|
158
158
|
# Dashboard integration
|
159
159
|
def call_source(options)
|
160
160
|
return @client.send(@source, options).first[1] if dashboard? || likes?
|
161
|
-
@client.send(@source, @blog_url, options)
|
161
|
+
@client.send(check_for_publish(@source), @blog_url, options)
|
162
|
+
end
|
163
|
+
|
164
|
+
def check_for_publish(source)
|
165
|
+
return source unless source.eql?(PUBLISH)
|
166
|
+
:posts
|
162
167
|
end
|
163
168
|
|
164
169
|
# Get @limit # of Posts
|
data/lib/draftking/posts/post.rb
CHANGED
@@ -21,7 +21,11 @@ module DK
|
|
21
21
|
@changed = false
|
22
22
|
@saved = 0
|
23
23
|
@comment = @data.reblog.comment
|
24
|
-
@from =
|
24
|
+
@from = begin
|
25
|
+
@data.trail.first.blog.name
|
26
|
+
rescue
|
27
|
+
'<no ID>'
|
28
|
+
end
|
25
29
|
|
26
30
|
# Direct map
|
27
31
|
@id = @data.id
|
@@ -166,6 +170,7 @@ module DK
|
|
166
170
|
def process_state(state)
|
167
171
|
return DK::DRAFT unless state || state.empty
|
168
172
|
return DK::QUEUE if state == 'queued'
|
173
|
+
return DK::PUBLISH if state.include?('pub')
|
169
174
|
state
|
170
175
|
end
|
171
176
|
|
data/lib/draftking/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tumblr_draftking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Meissa Dia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tumblr_client
|