DESC = "&description=%{desc}"
REBLOG = "&post-id=%{id}&reblog-key=%{reblog}"
COMMENT = "&comment=%{desc}"
+ TAGS = "&tags=%{tags}"
def help(plugin, topic="")
case topic
line = "<#{nick}> #{line}"
end
html_line = line ? CGI.escapeHTML(line) : line
+ tags = line ? line.scan(/\[([^\]]+)\]/).flatten : []
req = LOGIN % account
ready = false
req << (data % {
:id => id,
:reblog => reblog,
- :desc => CGI.escape(htmlline)
+ :desc => CGI.escape(html_line)
})
ready = true
end
data << NAME if line
end
end
+ data << TAGS unless tags.empty?
req << (data % {
:src => CGI.escape(url),
:desc => CGI.escape(html_line),
+ :tags => CGI.escape(tags.join(',')),
:name => CGI.escape(line)
})
end
plugin.map 'tumblr deconfigure [:channel]', :action => :deconfigure
plugin.map 'tumblr configure [:channel] :email :pwd [:group]',
:action => :configure,
- :requirements => {:channel => Regexp::Irc::GEN_CHAN, :email => /.+@.+/, :group => /[A-Za-z-]+/}
+ :requirements => {:channel => Regexp::Irc::GEN_CHAN, :email => /\S+@\S+/, :group => /[A-Za-z\-.]+/}