descartes 0.3.6 → 0.3.7

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: 83606d65464496323278094ce1d30fb8a6143513
4
- data.tar.gz: 2a3cdceff046aa16e446d42703d753f7cff8c638
3
+ metadata.gz: e7210a8590818498b893495bd154a7635c6b84f6
4
+ data.tar.gz: 0998a0bfdec1ea0bfd29248517fe7d1adac04ef0
5
5
  SHA512:
6
- metadata.gz: 6e4b732c321ebf557ae6b0ba46f143c12ceb96e0d9cf4df028a6e711522d2f1135daa684e3582bc145cd8d417b1dbd2c4284f4498001788b2ac32629485dafce
7
- data.tar.gz: b9222026e688fcb0a9a950dbf233d0f1d65ea49549699c398b1c9814f0f84d5471e5bb5f983d655aad0a4e49d0da26cdc984e1b816607d928b32687b6889f2e4
6
+ metadata.gz: e1ac65bab5fe97d93f37ba6e4713d746cb98d97140825b2cf243ffdb3cb02a529a55811c47567ce868b8ea86abaeaa9a1349922a0a80c1e6a4c2234820f092af
7
+ data.tar.gz: cc2d3c7e2f900fb7f5135e221f88713a413a259bd4d250cc54ab91b1dfbe032d7ef3b178b6d1a35fc61d9828220cd4befdb274f64408729612dda7790b2eb98f
@@ -13,17 +13,17 @@
13
13
  ##
14
14
 
15
15
  class Descartes
16
- class Reply
17
- include Cinch::Plugin
16
+ class Reply
17
+ include Cinch::Plugin
18
18
 
19
- match /#{@@nickname}.*\?/, :use_prefix => false
19
+ match /#{@@nickname}.*\?/, :use_prefix => false
20
20
 
21
- def execute(m)
21
+ def execute(m)
22
22
  file = File.expand_path '../reply/replies.txt', __FILE__
23
- replies = [].tap { |ary|
23
+ replies = [].tap { |ary|
24
24
  File.read(file).each_line { |line| ary << line unless line.empty? }
25
25
  }
26
- m.reply replies[rand(1..replies.length)]
27
- end
28
- end
29
- end
26
+ m.reply replies[rand(1..replies.length)]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # encoding: UTF-8
2
+ # ##
3
+ # ## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
4
+ # ## Version 2, December 2004
5
+ # ##
6
+ # ## Everyone is permitted to copy and distribute verbatim or modified
7
+ # ## copies of this license document, and changing it is allowed as long
8
+ # ## as the name is changed.
9
+ # ##
10
+ # ## DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ # ## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+ # ##
13
+ # ## 0. You just DO WHAT THE FUCK YOU WANT TO.
14
+ # ##
15
+ require 'nokogiri'
16
+ require 'open-uri'
17
+
18
+ class Descartes
19
+ class Treccani
20
+ include Cinch::Plugin
21
+ match /syn ([a-zA-Z]+)/
22
+
23
+ def execute(m, word)
24
+ url = "http://www.treccani.it/vocabolario/#{word}_(Sinonimi-e-Contrari)/"
25
+ page = Nokogiri::HTML(open(url))
26
+ m.reply page.xpath('//div[@class="spiega attacco"]/p').text.strip + " di più qui: #{url}"
27
+ end
28
+ end
29
+ end
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.3.6'
17
+ '0.3.7'
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: descartes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
@@ -84,6 +84,7 @@ files:
84
84
  - lib/descartes/modules/seen.rb
85
85
  - lib/descartes/modules/shinbo.rb
86
86
  - lib/descartes/modules/sindaco.rb
87
+ - lib/descartes/modules/synonyms.rb
87
88
  - lib/descartes/modules/trec.rb
88
89
  - lib/descartes/modules/url.rb
89
90
  - lib/descartes/utils.rb