tumblr_draftking 0.9.0 → 0.9.0.1
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 +4 -1
- data/lib/draftking/client.rb +1 -0
- data/lib/draftking/drafts.rb +0 -1
- data/lib/draftking/posts.rb +2 -1
- data/lib/draftking/posts/post.rb +3 -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: b467fdc8e8dfff072274c922a778113eafed27cc
|
4
|
+
data.tar.gz: b75d1550b3bc6595f50cb6aa66a77e15903fc2f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ea18de0ec33ddb903810e4f0273e88880d4f18b982d0e848a0b160d248955ef122be729dc57ef8470de5e11be94ed535beafa89b29cddafefe9be421c270965
|
7
|
+
data.tar.gz: b921fa8dae0ee1ef5b38ccc3bb0b123c18d8653bf74db3230a2726f7d148025579b83eab235b325d0d5ebd579c3490b678de424c05c5248fb2ee8f5ab12504c5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -241,10 +241,13 @@ $ dk ap -b 'test-blog' -c 'draftking auto poster' -k -t 'new,tags,to,add' -s :dr
|
|
241
241
|
- Upload to secondary blog (-b BLOG_NAME)
|
242
242
|
- Provide a url to visit when photo is clicked (-l LINK_URL)
|
243
243
|
- Add tags #blog2, #my upload (-t)
|
244
|
+
- Input file format example available via `$ dk help ups`
|
244
245
|
|
245
246
|
```ruby
|
246
247
|
$ dk ups -f /Users/meis/Desktop/new_stuff.txt -b blog2 -l blog2.tumblr.com -t 'blog2, my upload,'
|
247
|
-
```
|
248
|
+
```
|
249
|
+
|
250
|
+
|
248
251
|
|
249
252
|
#### Testing Console
|
250
253
|
The dk console can act as a sandbox while you explore the api or you can use it to actively manage your account.
|
data/lib/draftking/client.rb
CHANGED
@@ -45,6 +45,7 @@ module DK
|
|
45
45
|
@source = process_source(options[:source])
|
46
46
|
@before_id = options[:before_id] || 0
|
47
47
|
@offset = options[:offset] || 0
|
48
|
+
@greedy = options[:greedy] || @greedy
|
48
49
|
@limit = options[:limit]
|
49
50
|
@type = options[:type]
|
50
51
|
@blog_url = tumblr_url(@blog_name)
|
data/lib/draftking/drafts.rb
CHANGED
@@ -34,7 +34,6 @@ module DK
|
|
34
34
|
options[:message] = 'Moving Drafts -> Queue: '
|
35
35
|
options[:shuffle] = true
|
36
36
|
options[:state] = DK::QUEUE
|
37
|
-
options[:limit] = options[:greedy] ? (nil || options[:limit]) : @q_space
|
38
37
|
post_operation(options) do |post, index|
|
39
38
|
next false unless index_within_limit?(index, @q_space)
|
40
39
|
next false unless post.has_key_text?(@key_text)
|
data/lib/draftking/posts.rb
CHANGED
@@ -46,6 +46,7 @@ module DK
|
|
46
46
|
process_options(options)
|
47
47
|
act_on_blog(name: @blog_name)
|
48
48
|
posts = @shuffle ? get_posts.reverse.shuffle : get_posts.reverse
|
49
|
+
posts = posts.take(@limit) if @limit
|
49
50
|
work = posts_to_queue(posts)
|
50
51
|
reporter = options[:reporter] || DK::Reporter
|
51
52
|
[work, work.size, Queue.new, reporter]
|
@@ -124,7 +125,7 @@ module DK
|
|
124
125
|
print "Getting posts...\r" unless @mute
|
125
126
|
return some_test_data if @test_data
|
126
127
|
return some_posts(offset: @offset) if dashboard?
|
127
|
-
return all_posts.uniq
|
128
|
+
return all_posts.uniq if @greedy || @limit.nil?
|
128
129
|
return some_posts(offset: @offset, before_id: @before_id) if @limit <= 50
|
129
130
|
limited_posts
|
130
131
|
end
|
data/lib/draftking/posts/post.rb
CHANGED
@@ -4,6 +4,8 @@ include DK::Posts
|
|
4
4
|
module DK
|
5
5
|
# Tumblr Post
|
6
6
|
class Post
|
7
|
+
attr_accessor :comment, :image, :photoset, :changed, :saved, :comment
|
8
|
+
attr_accessor :state, :data, :reblog_key, :tags, :blog_url, :summary
|
7
9
|
# @param hash [Hash] Post Data
|
8
10
|
# @param keep_tree [Bool] Attach Reblog Tree?
|
9
11
|
def initialize(hash, keep_tree: nil)
|
@@ -19,6 +21,7 @@ module DK
|
|
19
21
|
@changed = false
|
20
22
|
@saved = 0
|
21
23
|
@comment = @data.reblog.comment
|
24
|
+
@from = @data.trail.first.blog.name rescue '<no ID>'
|
22
25
|
|
23
26
|
# Direct map
|
24
27
|
@id = @data.id
|
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.0.1
|
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-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tumblr_client
|