ruboty-imascg 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty-imascg/version.rb +1 -1
- data/lib/ruboty/handlers/imascg.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92433fa34273b152f218f381bfd0247f89d63251
|
4
|
+
data.tar.gz: a7da52d0934546d678939040826595ed42308fbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5ae430803e17f0181af909eb80b58ff60411b0916535c48c5567a8c3063d4efbf6a0ad5915baea65c2065e46e7de2366f7b9f2f7897092adf5fa0ad131e2e08
|
7
|
+
data.tar.gz: 0a9543b10c15f2ea0e1f96025a30b864fa5f9c13d03b13e014b576c55e9a88183b5c35378e1e9ea718777ff49567802d1454290f3bb1df518bb2f37c7fb494fe
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "ruboty-imascg/version"
|
2
2
|
require 'ruboty/handlers/base'
|
3
3
|
require 'net/http'
|
4
|
+
require 'net/https'
|
4
5
|
require 'json'
|
5
6
|
require 'uri'
|
6
7
|
|
@@ -8,7 +9,7 @@ module Ruboty
|
|
8
9
|
module Handlers
|
9
10
|
class Imascg < Base
|
10
11
|
VERSION = RubotyImascg::VERSION
|
11
|
-
PPDB_API = URI("
|
12
|
+
PPDB_API = URI("https://ppdb.momoka-sakurai.com/api/2/idol.json")
|
12
13
|
IMG_URL = "http://125.6.169.35/idolmaster/image_sp/card/%s/%s.jpg"
|
13
14
|
|
14
15
|
on(/imascg(?:\s+?(?<mode>.+?))?(?:\s+?me)?\s+(?<query>.+)$/, name: 'imascg', description: 'find imascg cards')
|
@@ -37,7 +38,8 @@ module Ruboty
|
|
37
38
|
if mode == 'list'
|
38
39
|
message.reply response['data'].map{ |_| _['Name'] }.join("\n")
|
39
40
|
else
|
40
|
-
card =
|
41
|
+
card = response['data'].find { |card| card['Name'] == message[:query] } \
|
42
|
+
|| response['data'].sample
|
41
43
|
message.reply card['Name']
|
42
44
|
message.reply IMG_URL % [mode, card['ID']]
|
43
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-imascg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Fukumori (sora_h)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruboty
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.6.8
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Let ruboty find imas_cg cards using ppdb.sekai.in
|