shinybooru 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shinybooru.rb +12 -3
- data/lib/shinybooru/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78cf11085d91473d57ae2cb367f5b58bada57624
|
4
|
+
data.tar.gz: f3b443d517268036e7c4de330ac5cc82784e3acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d181725b2a01b3e0cd8c0c504350d78cea0624d6b08d4773c18244b53b67a6bd092b8aff112d0117117eef974fe97e2b7d3ca96c447bdacf5f399c8656e16505
|
7
|
+
data.tar.gz: ee55aabcc622c3175a954c6bfcdae72291fadeb5031403fca123c1876536196bf0ab42cf633669b678e403f1b61f8174e78509bc2ad8a02395a62b0cbe0d5352
|
data/lib/shinybooru.rb
CHANGED
@@ -28,13 +28,22 @@ module Shinybooru
|
|
28
28
|
@booru.get '/index.php?page=dapi&s=post&q=index' + page
|
29
29
|
end
|
30
30
|
|
31
|
-
def posts (
|
31
|
+
def posts (args=Hash.new)
|
32
|
+
limit = args[:limit]
|
33
|
+
limit = 1 if limit.nil?
|
34
|
+
nsfw = args[:nsfw]
|
35
|
+
nsfw = true if nsfw.nil?
|
36
|
+
tags = args[:tags]
|
37
|
+
tags = [] if tags.nil?
|
32
38
|
if @online
|
33
39
|
req = '&limit=' + limit.to_s
|
34
40
|
if tags
|
35
|
-
|
41
|
+
unless tags.is_a? String
|
42
|
+
tags = tags.join('%20')
|
43
|
+
end
|
44
|
+
req += '&tags=' + tags
|
36
45
|
end
|
37
|
-
|
46
|
+
unless nsfw
|
38
47
|
explicit_tags = '-rating%3aquestionable%20-rating%3explicit'
|
39
48
|
unless tags
|
40
49
|
req += '&tags=' + explicit_tags
|
data/lib/shinybooru/version.rb
CHANGED