From 680716b32b3406233d8973d44ee8df0cb52b73ef Mon Sep 17 00:00:00 2001 From: lookshe Date: Wed, 7 Mar 2012 01:00:36 +0100 Subject: add youtube title --- tinyurl.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tinyurl.tcl b/tinyurl.tcl index 83cc27a..e0fcba3 100644 --- a/tinyurl.tcl +++ b/tinyurl.tcl @@ -66,6 +66,12 @@ foreach act_arg $arg { putserv "PRIVMSG $chan :\002Tiny URL\002: $tinyurl \[$title\] (URL by \002$nick\002)" } } + + if {([string match "*youtube*watch*" $url] == 1)} { + set title [exec perl -e "use URI::Title;print URI::Title::title(\"$url\");"] + set title [string range $title 0 end-10] + putserv "PRIVMSG $chan :\002Youtube\002: $title (Video by \002$nick\002)" + } } } return 0 -- cgit v1.2.3