cinch-lastfm 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cinch/plugins/lastfm.rb +5 -2
- metadata +2 -2
data/lib/cinch/plugins/lastfm.rb
CHANGED
@@ -3,6 +3,7 @@ require 'nokogiri'
|
|
3
3
|
require 'open-uri'
|
4
4
|
require 'redis'
|
5
5
|
require 'redis-namespace'
|
6
|
+
require 'cgi'
|
6
7
|
|
7
8
|
module Cinch
|
8
9
|
module Plugins
|
@@ -26,13 +27,14 @@ module Cinch
|
|
26
27
|
# Redis backend
|
27
28
|
end
|
28
29
|
|
29
|
-
match %r{np (
|
30
|
-
match %r{link (
|
30
|
+
match %r{np (.+)}, :method => :now_playing
|
31
|
+
match %r{link (.+)}, :method => :link_account
|
31
32
|
match %r{np$}, :method => :now_playing_user
|
32
33
|
|
33
34
|
|
34
35
|
# Gets Now Playing for an user
|
35
36
|
def now_playing(m, nick)
|
37
|
+
nick = CGI::escape(nick)
|
36
38
|
artist, track = get_data(nick)
|
37
39
|
m.reply("#{nick} has recently played: #{artist} - #{track}")
|
38
40
|
end
|
@@ -48,6 +50,7 @@ module Cinch
|
|
48
50
|
|
49
51
|
# Links a designated Last Fm account
|
50
52
|
def link_account(m, nick)
|
53
|
+
nick = CGI::escape(nick)
|
51
54
|
@backend.set(m.user, nick)
|
52
55
|
m.reply("#{m.user} is now linked with account #{nick}!")
|
53
56
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch-lastfm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|