descartes 0.3.15 → 0.3.16

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: 0baa4ab36ffdc0836287504609c477e99faa4318
4
- data.tar.gz: d009e17f9f20d6100ca1ef7bb6450b8f05ac21d9
3
+ metadata.gz: 3c15e7788e0c464a5cfbf345e508b94362a8d19f
4
+ data.tar.gz: cb63ff6a9d1b67295a8208b174fbc7ea507b8bea
5
5
  SHA512:
6
- metadata.gz: eeb8c4324c953783455c5051b427c16c6a7d63b62446b64890180ba4da5b438e3cc00989f4813fc126c0dfd9cda87ce2682100def2bbed58f8959744b2dd3033
7
- data.tar.gz: cad426f2d38e212e3d5104c4e5a08f22bfc9f4e6de66a9a78f0572c492f5d8e1ab5b2e51a052e83f3ddc3cce15e5b6f57f22fa19e96d2d2ab29949016eb1b27b
6
+ metadata.gz: e8bde749d631421e03b6b48c5755a6efdff801cbfbae9abf1353f4224dcfca4ea4168c3e3bdcb8e97194502e7e0db743a1322c92adcd2322623e7815b6f2e859
7
+ data.tar.gz: 363acf13595609620e8f11b9ce06b74eafbc07574abedcc409a0d95c2c11ab2936256b1837416ee1ec8cdde6f41e28109080b32dcc9aec94f9dda6275d8c5fa7
@@ -0,0 +1,30 @@
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 Dicteng
20
+ include Cinch::Plugin
21
+
22
+ match /([a-zA-Z]+) ([a-zA-Z]+)/, :use_prefix => false
23
+
24
+ def execute(m, action, word)
25
+ url = "http://www.wordreference.com/#{action}/#{word}"
26
+ page = Nokogiri::HTML(open(url))
27
+ m.reply "#{page.xpath('//table[@class="WRD"]/tr[2]').text} di più qui: #{url}"
28
+ end
29
+ end
30
+ end
@@ -44,7 +44,7 @@ class Descartes
44
44
  user = Rockstar::User.new lastfmnick
45
45
  track = user.recent_tracks.first
46
46
 
47
- album = track.album ? "in #{track.album}" : 'in no known album'
47
+ album = track.album.empty? ? "in #{track.album}" : 'in no known album'
48
48
  if track.now_playing?
49
49
  m.reply "#{lastfmnick} is listening to #{track.name} by #{track.artist} (#{album}) right now!"
50
50
  else
@@ -26,9 +26,9 @@ class Descartes
26
26
  page = Nokogiri::HTML(open("http#{ssl}://#{url}").read, nil, 'utf-8')
27
27
 
28
28
  if url.match('youtube.com|youtu.be') != nil
29
- m.reply page.css('//title').first.text.chomp(' - YouTube')
29
+ m.reply Format(:pink, "[Youtube] #{page.css('//title').first.text.chomp(' - YouTube')}")
30
30
  else
31
- m.reply page.css('//title').first.text.strip
31
+ m.reply Format(:red, "[URL] #{page.css('//title').first.text.strip}")
32
32
  end
33
33
  rescue; end
34
34
  end
@@ -14,6 +14,6 @@
14
14
 
15
15
  class Descartes
16
16
  def self.version
17
- '0.3.15'
17
+ '0.3.16'
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.3.15
4
+ version: 0.3.16
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-16 00:00:00.000000000 Z
11
+ date: 2013-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cinch
@@ -132,6 +132,7 @@ files:
132
132
  - lib/descartes/descartes.rb
133
133
  - lib/descartes/modules/crunchyroll.rb
134
134
  - lib/descartes/modules/currency.rb
135
+ - lib/descartes/modules/dicteng.rb
135
136
  - lib/descartes/modules/files/replies.txt
136
137
  - lib/descartes/modules/files/sindaco.txt
137
138
  - lib/descartes/modules/google.rb