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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f59f0f89fc39793a8364d12a17ff74b2f48df07c
4
- data.tar.gz: 2ce4446162084910078c68ca9300ed50e5c13e2f
3
+ metadata.gz: 92433fa34273b152f218f381bfd0247f89d63251
4
+ data.tar.gz: a7da52d0934546d678939040826595ed42308fbc
5
5
  SHA512:
6
- metadata.gz: f91fd6f4f7a95313a96ceea27bfc2129a02f63e6131582b9810c3f843a1c704b495bcfcd106dca8a15d4ae16717c653c611ab9a5f255a89e1ba3d89eba45706c
7
- data.tar.gz: bc213f1890ee3098e4c8c51ead96c9c8c31351ae3e82e174ed02ece77624bc43723f5c9aa566f691f8a17ec4a6a0c0574f48e990a0f1aa30700e27de111da8b5
6
+ metadata.gz: d5ae430803e17f0181af909eb80b58ff60411b0916535c48c5567a8c3063d4efbf6a0ad5915baea65c2065e46e7de2366f7b9f2f7897092adf5fa0ad131e2e08
7
+ data.tar.gz: 0a9543b10c15f2ea0e1f96025a30b864fa5f9c13d03b13e014b576c55e9a88183b5c35378e1e9ea718777ff49567802d1454290f3bb1df518bb2f37c7fb494fe
@@ -1,3 +1,3 @@
1
1
  module RubotyImascg
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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("http://ppdb.sekai.in/api/2/idol.json")
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 = response['data'].sample
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.0.0
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: 2014-10-05 00:00:00.000000000 Z
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.2.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