ruby34 1.0.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 +7 -0
- data/lib/ruby34.rb +21 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a5d17933c550229058227457ffb86d18e29330c723239f48f0df53f19c01e12e
|
4
|
+
data.tar.gz: a2b1c2b9958ad5cc47392617f1bec316666af7325bf04974ec358672aae51a7b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b90a9c35153df38b232809da5232ce68c69c81778ece9b6f75b14a6d18c88d0691123f6b8904cdd31afa7537039e40fba243adfec1e710b47bf41b856cf911e7
|
7
|
+
data.tar.gz: 6c50369bc8668ac8f99e965bd3d2697892162f3d93df882c8b74aaa912383ec21ac6081973f24fe0b2344e43ad753bfd64a3dc3c8b735573b19d5f5aa1907d69
|
data/lib/ruby34.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
|
3
|
+
class Ruby34
|
4
|
+
|
5
|
+
# Basically just a test function
|
6
|
+
def self.hai
|
7
|
+
puts "Haiii!! (from Ruby34 :3)"
|
8
|
+
end
|
9
|
+
|
10
|
+
# Make a request to the Rule34 API
|
11
|
+
def self.request(limit: nil, json: nil, tags: nil, id: nil)
|
12
|
+
# See API reference here: https://api.rule34.xxx/index.php
|
13
|
+
base_uri = "https://api.rule34.xxx/index.php?page=dapi&s=post&q=index"
|
14
|
+
base_uri << "&limit=" << limit if limit != nil
|
15
|
+
base_uri << "&json=1" if json == true
|
16
|
+
base_uri << "&tags=" << tags.join('+').to_s if tags != nil
|
17
|
+
base_uri << "&id=" << id.to_s if id != nil
|
18
|
+
uri = URI(base_uri)
|
19
|
+
Net::HTTP.get(uri)
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruby34
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Maxi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-12-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Rule34 API wrapper in Ruby
|
14
|
+
email: voynich@voyni.ch
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/ruby34.rb
|
20
|
+
homepage: https://dev.queers.online/maxi/ruby34
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubygems_version: 3.3.25
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: Rule34 API wrapper
|
43
|
+
test_files: []
|