descartes 0.4 → 0.5

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: b0b57aa9de1df1c113ebb033c34a5130f36ee934
4
- data.tar.gz: 73d20235abaf909f4410e04ddbbab5725dc5b0f0
3
+ metadata.gz: 8007c7670b73ac62de69d1046a7d2cf93649cbca
4
+ data.tar.gz: cd33eec7db80da9f90ff4298ed9ae347c228ce7b
5
5
  SHA512:
6
- metadata.gz: 581c343dd71d0140fff87c46f61687df21fd04acd02ee8b8a926cbabd1f83528880cbe426cb8f1852cd1c396808b1af38d4fbf9a424cd978d57ce8c016d04805
7
- data.tar.gz: b35bde8554bcafd40e517f27e5fb64a91cf53d13d4455688c2f51d9b3e387015745a3136398952a3bb815889d0867b79e6c4249c6231a17dec153243a75668f8
6
+ metadata.gz: 2d0ca5fb226de0c31e5be57dc44af409c7394ef44fc4aeba74b52564331194770575e323917784feb87a3e055cae8e2ec71f7f82cb80c8f1377e724793dc1220
7
+ data.tar.gz: fbb40197d86f6cbf87d7ade09c736df4ee4c72cf9cb2bb6f9e87afe02aa6064e3c68a5215d514b7668a23be6367c4ebdc7b6258f01cdb87d4b6f1ec107cbfb76
data/bin/descartes CHANGED
@@ -74,4 +74,8 @@ Cinch::Bot.new {
74
74
  m.reply '“…”'
75
75
  end
76
76
 
77
+ on :message, '!version' do |m|
78
+ m.reply Descartes.version
79
+ end
80
+
77
81
  }.start
@@ -19,7 +19,7 @@ class Descartes
19
19
  class Dicteng
20
20
  include Cinch::Plugin
21
21
 
22
- match /([a-zA-Z]+) ([a-zA-Z]+)/, :use_prefix => false
22
+ match /!dict ([a-zA-Z]+) ([a-zA-Z]+)/, :use_prefix => false
23
23
 
24
24
  def execute(m, action, word)
25
25
  url = "http://www.wordreference.com/#{action}/#{word}"
@@ -0,0 +1,2 @@
1
+ api_key:
2
+ api_secret:
@@ -0,0 +1 @@
1
+ http://localhost:4567
@@ -21,10 +21,8 @@ class Descartes
21
21
  include Cinch::Plugin
22
22
 
23
23
  def authenticate!
24
- Rockstar.lastfm = {
25
- :api_key => 'bc15f325a6aa7dcc4e8d2df74ade7cdd',
26
- :api_secret => 'c055b169a789ce6491a1b016ff6ebb21'
27
- }
24
+ file = File.join File.dirname(__FILE__), 'files', 'lastfm_api.yml'
25
+ Rockstar.lastfm = YAML.load_file file
28
26
  end
29
27
 
30
28
  def get_lastfm_nicks_archive
@@ -0,0 +1,73 @@
1
+ ##
2
+ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3
+ # Version 2, December 2004
4
+ #
5
+ # Everyone is permitted to copy and distribute verbatim or modified
6
+ # copies of this license document, and changing it is allowed as long
7
+ # as the name is changed.
8
+ #
9
+ # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
10
+ # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
11
+ #
12
+ # 0. You just DO WHAT THE FUCK YOU WANT TO.
13
+ ##
14
+
15
+ require 'assonnato'
16
+
17
+ class Descartes
18
+ class Pigro
19
+ include Cinch::Plugin
20
+ match /dat_show (.+) (.+)/
21
+
22
+ def execute(m, keyword, n_ep)
23
+ host = get_host 'pigro.txt'
24
+ series = Assonnato::Show.new(host, :json).search! keyword
25
+ episodes = Assonnato::Episode.new host, :json
26
+
27
+ if series.empty?
28
+ m.reply 'Series not found'
29
+ return
30
+ end
31
+
32
+ series.each { |s|
33
+ m.reply "#{s.name.colorize} (#{s.status} series of #{s.tot_episodes} episodes airing #{s.airing})"
34
+ m.reply ''.tap { |staff|
35
+ {
36
+ :Translator => s.translator,
37
+ :Editor => s.editor,
38
+ :Checker => s.checker,
39
+ :Timer => s.timer,
40
+ :Typesetter => s.typesetter,
41
+ :Encoder => s.encoder,
42
+ :QC => s.qchecker
43
+ }.each_pair { |key, val|
44
+ staff << "#{key.to_s.colorize}: #{val} / " unless val.empty?
45
+ }
46
+ }[0..-4]
47
+
48
+ eps = episodes.get! s.name, n_ep.to_i
49
+ eps.each { |ep|
50
+ m.reply "Episode #{ep.episode} - ".colorize.tap { |staff|
51
+ {
52
+ :Translation => ep.translation,
53
+ :Editing => ep.editing,
54
+ :Check => ep.checking,
55
+ :Timing => ep.timing,
56
+ :Typesetting => ep.typesetting,
57
+ :Encoding => ep.encoding,
58
+ :QC => ep.qchecking
59
+ }.each_pair { |key, val|
60
+ staff << "#{key.to_s.colorize}: #{val ? 'gg' : 'nope'} / "
61
+ }
62
+ staff << 'Download'.colorize + ": #{ep.download}" if ep.download
63
+ }[0..-4]
64
+ }
65
+ }
66
+ end
67
+
68
+ def get_host(f)
69
+ file = File.join File.dirname(__FILE__), 'files', f
70
+ File.exists?(file) ? File.read(file) : 'http://localhost'
71
+ end
72
+ end
73
+ end
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.4'
17
+ '0.5'
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descartes
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-25 00:00:00.000000000 Z
11
+ date: 2013-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: assonnato
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: A serious modular ruby IRC bot.
140
154
  email: webmaster@giovannicapuano.net
141
155
  executables:
@@ -147,11 +161,14 @@ files:
147
161
  - lib/descartes/modules/crunchyroll.rb
148
162
  - lib/descartes/modules/currency.rb
149
163
  - lib/descartes/modules/dicteng.rb
164
+ - lib/descartes/modules/files/lastfm_api.yml
165
+ - lib/descartes/modules/files/pigro.txt
150
166
  - lib/descartes/modules/files/replies.txt
151
167
  - lib/descartes/modules/files/sindaco.txt
152
168
  - lib/descartes/modules/google.rb
153
169
  - lib/descartes/modules/lastfm.rb
154
170
  - lib/descartes/modules/musicthoughts.rb
171
+ - lib/descartes/modules/pigro.rb
155
172
  - lib/descartes/modules/quotone.rb
156
173
  - lib/descartes/modules/reply.rb
157
174
  - lib/descartes/modules/rpn.rb