shinybooru 1.0.0 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d48ee76ccc23893b76a9d5632fb413908bbeb664
4
- data.tar.gz: 441aa95fa1f277d5c86d955448c548de4b72fbbd
3
+ metadata.gz: a84d8967d4a77823969e563973a0d140ce497e1a
4
+ data.tar.gz: 0c19188e275b6fd3f5a58a8ce7358f81bddc9268
5
5
  SHA512:
6
- metadata.gz: 1b62953e6a2f596283b701eb5f67198614cc64c6ad682125a2acddba40a5c1dca02101ed8d2c8d0272d73c97b3e7cc6dca3d944949bdc43f67358284ec36198a
7
- data.tar.gz: b0e8ef0ca2e2d1cc57ef73bb86b76536c24778435bbb1448e58926044120d3a0e6f9a035a7a7df39a115a3e25e8c2153cd4889e27e4aa8c1beeb96ab6597a416
6
+ metadata.gz: ede56dfa3a8e6b3659d253efe979f48836348fa9293f821ea4e471b9000d8f5717f1055e08ecfbc869d7469dadf09f9c7ca46a03ca8e5029762a53d1c54cfb2f
7
+ data.tar.gz: e0de153b4fb0b4d397e770bdbf57248a4dd1feaf20a92974b3824079242adcaa64d8a66095114a7fb7c33c5eab7d4c337dc8840f37c5ac0f81517c219d135b50
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Shinybooru
2
+ [![Build Status](https://travis-ci.org/calvcoll/shinybooru.svg?branch=master)](https://travis-ci.org/calvcoll/shinybooru)
2
3
 
3
4
  A gem which returns an easy to use object for Gelbooru requests
4
5
 
@@ -28,9 +28,21 @@ module Shinybooru
28
28
  @booru.get '/index.php?page=dapi&s=post&q=index' + page
29
29
  end
30
30
 
31
- def posts (limit=1)
31
+ def posts (limit=1, nsfw=true, tags=[])
32
32
  if @online
33
- data = Nokogiri::Slop((booru_get '&limit=' + limit.to_s).body)
33
+ req = '&limit=' + limit.to_s
34
+ if tags
35
+ req += '&tags=' + tags.join('%20')
36
+ end
37
+ if nsfw
38
+ explicit_tags = '-rating%3aquestionable%20-rating%3explicit'
39
+ unless tags
40
+ req += '&tags=' + explicit_tags
41
+ else
42
+ req += '%20' + explicit_tags
43
+ end
44
+ end
45
+ data = Nokogiri::Slop((booru_get req).body)
34
46
  posts = []
35
47
  data.posts.children.each do |post|
36
48
  if post.is_a? Nokogiri::XML::Element
@@ -1,3 +1,3 @@
1
1
  module Shinybooru
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shinybooru
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Calv Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-27 00:00:00.000000000 Z
11
+ date: 2015-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler