tumblr_draftking 0.9.0.3 → 0.9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -2
- data/lib/draftking/cli/cli_options.rb +1 -0
- data/lib/draftking/cli/commands/autoposter.rb +3 -2
- data/lib/draftking/cli/commands/comment.rb +3 -2
- data/lib/draftking/cli/commands/movedrafts.rb +3 -2
- data/lib/draftking/cli/commands/strip.rb +1 -0
- data/lib/draftking/cli/commands/tag.rb +1 -0
- data/lib/draftking/cli/commands/uploads.rb +1 -0
- data/lib/draftking/client.rb +1 -0
- data/lib/draftking/posts.rb +11 -11
- data/lib/draftking/posts/post.rb +1 -1
- data/lib/draftking/posts/posts_helpers.rb +9 -1
- 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: e7e8c7b5b045f41f100e52afe1faec27dcca83db
|
4
|
+
data.tar.gz: 206cecc7a334f8083965c7e0adb0761f20b400cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9f9d25fe5a8c88a1b2f014bf096c5133a6f0bed1fc913621f80fa7fede68d335f0e2a506a4c6e7a92e7aeaacb790ae86e65503aed5c76b407f00e3987b2e410
|
7
|
+
data.tar.gz: ea3553b4e384dbb3146affca11b05324b32bbb2c26feb3518a28564f1f8c5504db98f03d1f2f2e917c3229c42f0ef223c96745783085d1d1903f4d7348edc5e1
|
data/CHANGELOG.md
CHANGED
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.9.0
|
19
|
-
+
|
18
|
+
Version 0.9.1.0
|
19
|
+
+ Added CLI option (--no-show-pi) to hide progress indicators. (--mute) can still be used to silence progress messages and the final report.
|
20
20
|
|
21
21
|
+ Please report any [issues] you encounter!
|
22
22
|
+ [Change Log](./CHANGELOG.md)
|
@@ -19,8 +19,9 @@ module DK
|
|
19
19
|
option :simulate, type: :boolean, aliases: :s, desc: Options.op_strings[:simulate]
|
20
20
|
option :keep_tags, type: :boolean, aliases: :k, desc: Options.op_strings[:keep_tags]
|
21
21
|
option :keep_comments, type: :boolean, aliases: :K, desc: Options.op_strings[:keep_comments]
|
22
|
-
option :credit, type: :boolean, desc: Options.op_strings[:credit],
|
23
|
-
option :tags, type: :boolean, desc: Options.op_strings[:tags],
|
22
|
+
option :credit, type: :boolean, desc: Options.op_strings[:credit], default: true
|
23
|
+
option :tags, type: :boolean, desc: Options.op_strings[:tags], default: true
|
24
|
+
option :show_pi, type: :boolean, desc: Options.op_strings[:show_pi], default: true
|
24
25
|
option :config, type: :string, desc: Options.op_strings[:config]
|
25
26
|
def autoposter
|
26
27
|
configured?
|
@@ -20,8 +20,9 @@ module DK
|
|
20
20
|
option :mute, type: :boolean, aliases: :m, desc: Options.op_strings[:mute]
|
21
21
|
option :keep_tags, type: :boolean, aliases: :k, desc: Options.op_strings[:keep_tags]
|
22
22
|
option :keep_comments, type: :boolean, aliases: :K, desc: Options.op_strings[:keep_comments]
|
23
|
-
option :credit, type: :boolean, desc: Options.op_strings[:credit],
|
24
|
-
option :tags, type: :boolean, desc: Options.op_strings[:tags],
|
23
|
+
option :credit, type: :boolean, desc: Options.op_strings[:credit], default: true
|
24
|
+
option :tags, type: :boolean, desc: Options.op_strings[:tags], default: true
|
25
|
+
option :show_pi, type: :boolean, desc: Options.op_strings[:show_pi], default: true
|
25
26
|
option :config, type: :string, desc: Options.op_strings[:config]
|
26
27
|
def comment(comm)
|
27
28
|
configured?
|
@@ -20,8 +20,9 @@ module DK
|
|
20
20
|
option :keep_tags, type: :boolean, aliases: :k, desc: Options.op_strings[:keep_tags]
|
21
21
|
option :keep_comments, type: :boolean, aliases: :K, desc: Options.op_strings[:keep_comments]
|
22
22
|
option :greedy, type: :boolean, aliases: :g, desc: Options.op_strings[:greedy]
|
23
|
-
option :
|
24
|
-
option :
|
23
|
+
option :show_pi, type: :boolean, desc: Options.op_strings[:show_pi], default: true
|
24
|
+
option :credit, type: :boolean, desc: Options.op_strings[:credit], default: true
|
25
|
+
option :tags, type: :boolean, desc: Options.op_strings[:tags], default: true
|
25
26
|
option :config, type: :string, desc: Options.op_strings[:config]
|
26
27
|
def movedrafts
|
27
28
|
configured?
|
@@ -8,6 +8,7 @@ module DK
|
|
8
8
|
option :blog, type: :string, aliases: :b, desc: Options.op_strings[:blog]
|
9
9
|
option :source, type: :string, aliases: :S, desc: Options.op_strings[:source]
|
10
10
|
option :simulate, type: :boolean, aliases: :s, desc: Options.op_strings[:simulate]
|
11
|
+
option :show_pi, type: :boolean, desc: Options.op_strings[:show_pi], default: true
|
11
12
|
option :config, type: :string, desc: Options.op_strings[:config]
|
12
13
|
def strip
|
13
14
|
configured?
|
@@ -11,6 +11,7 @@ module DK
|
|
11
11
|
option :keep_tags, type: :boolean, aliases: :k, desc: Options.op_strings[:keep_tags]
|
12
12
|
option :keep_comments, type: :boolean, aliases: :K, desc: Options.op_strings[:keep_comments]
|
13
13
|
option :credit, type: :boolean, desc: Options.op_strings[:credit], default: false
|
14
|
+
option :show_pi, type: :boolean, desc: Options.op_strings[:show_pi], default: true
|
14
15
|
option :config, type: :string, desc: Options.op_strings[:config]
|
15
16
|
def tag
|
16
17
|
opts = process_options(options)
|
@@ -33,6 +33,7 @@ module DK
|
|
33
33
|
option :simulate, type: :boolean, aliases: :s, desc: Options.op_strings[:simulate]
|
34
34
|
option :mute, type: :boolean, aliases: :m, desc: Options.op_strings[:mute]
|
35
35
|
option :add_tags, type: :string, aliases: :t, desc: Options.op_strings[:add_tags]
|
36
|
+
option :show_pi, type: :boolean, desc: Options.op_strings[:show_pi], default: true
|
36
37
|
option :config, type: :string, desc: Options.op_strings[:config]
|
37
38
|
def uploads
|
38
39
|
configured?
|
data/lib/draftking/client.rb
CHANGED
data/lib/draftking/posts.rb
CHANGED
@@ -42,7 +42,7 @@ module DK
|
|
42
42
|
|
43
43
|
# Common initialization for post operations
|
44
44
|
def setup_operation(options)
|
45
|
-
|
45
|
+
pprint "Setup\r"
|
46
46
|
process_options(options)
|
47
47
|
act_on_blog(name: @blog_name)
|
48
48
|
posts = @shuffle ? shufflex(get_posts.reverse, 3) : get_posts.reverse
|
@@ -126,7 +126,7 @@ module DK
|
|
126
126
|
# @param options[:offset] [Int] [:queue] Post index to start reading from
|
127
127
|
# @return [[Post]] Array of Post Hash data
|
128
128
|
def get_posts
|
129
|
-
|
129
|
+
pprint "Getting posts...\r"
|
130
130
|
return some_test_data if @test_data
|
131
131
|
return some_posts(offset: @offset) if dashboard?
|
132
132
|
return all_posts.uniq if @greedy || @limit.nil?
|
@@ -210,14 +210,14 @@ module DK
|
|
210
210
|
def auto_poster(options = {})
|
211
211
|
process_options(options)
|
212
212
|
act_on_blog(name: @blog_name)
|
213
|
-
|
213
|
+
pprint "Retrieving posts...(can take a while for large queues)\r"
|
214
214
|
posts = all_posts.reverse # FIFO
|
215
215
|
total = posts.size
|
216
|
-
|
217
|
-
|
216
|
+
pputs "Found #{total} posts in #{@source.capitalize}#{'s' if @source[0] == 'd'}."
|
217
|
+
pputs 'Press CTRL + C to exit.'
|
218
218
|
interval = 432 # 200 posts / 24 hours = 432sec
|
219
219
|
posts.each_with_index do |current, idx|
|
220
|
-
|
220
|
+
pprint "Publishing post #{idx}/#{total}.\r"
|
221
221
|
post = Post.new(current, keep_tree: @keep_tags)
|
222
222
|
post.change_state(DK::PUBLISH)
|
223
223
|
post.replace_comment_with(@comment)
|
@@ -226,15 +226,15 @@ module DK
|
|
226
226
|
exclude: @comment,
|
227
227
|
credit: true) if @auto_tag
|
228
228
|
unless post.save(client: @client, simulate: @simulate) > 0
|
229
|
-
|
230
|
-
|
231
|
-
|
229
|
+
pputs "Error at Index: #{idx}. Unable to save post!"
|
230
|
+
pputs "reblog_key: #{post.reblog_key}, id: #{post.post_id}"
|
231
|
+
pputs 'Quitting auto-poster.'
|
232
232
|
exit 1
|
233
233
|
end
|
234
|
-
|
234
|
+
pprint "Published #{idx}/#{total} posts. Next post at #{Time.now + interval}\r"
|
235
235
|
sleep interval unless idx == total
|
236
236
|
end # End of auto-posting
|
237
|
-
|
237
|
+
pputs 'Auto-Poster has completed!'
|
238
238
|
end
|
239
239
|
end
|
240
240
|
end
|
data/lib/draftking/posts/post.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
module DK
|
2
2
|
# Helper Methods
|
3
3
|
module Posts
|
4
|
+
def pputs(str)
|
5
|
+
puts str unless @mute || !@show_pi
|
6
|
+
end
|
7
|
+
def pprint(str)
|
8
|
+
puts str unless @mute || !@show_pi
|
9
|
+
end
|
10
|
+
|
4
11
|
# Display progress percentage
|
5
12
|
# @param current [Int] Progress Counter
|
6
13
|
# @param total [Int] # Items to be processed
|
@@ -8,9 +15,10 @@ module DK
|
|
8
15
|
# @param done [Bool] Processing Complete?
|
9
16
|
# @param modified [Int] # of items modified
|
10
17
|
def show_progress(current: 0, total: 0, message: '', done: false, modified: 0)
|
18
|
+
return unless @show_pi
|
11
19
|
indicator, newline, progress = setup_done(modified) if done
|
12
20
|
indicator, newline, progress = setup_undone(current, total) unless done
|
13
|
-
|
21
|
+
pprint "#{indicator}#{message}#{progress}#{' ' * 30}\r#{newline}"
|
14
22
|
$stdout.flush unless done
|
15
23
|
end
|
16
24
|
|
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.9.0
|
4
|
+
version: 0.9.1.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-03-
|
11
|
+
date: 2018-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tumblr_client
|