From 4811461b59768ea38612a78c07f4afeafe64cfa3 Mon Sep 17 00:00:00 2001 From: lookshe Date: Wed, 7 Mar 2012 01:21:24 +0100 Subject: better way to identify if it is really youtube --- tinyurl.tcl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tinyurl.tcl b/tinyurl.tcl index e0fcba3..e935555 100644 --- a/tinyurl.tcl +++ b/tinyurl.tcl @@ -69,8 +69,10 @@ foreach act_arg $arg { 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)" + if {([string match "* - YouTube" $title] == 1)} { + set title [string range $title 0 end-10] + putserv "PRIVMSG $chan :\002Youtube\002: $title (URL by \002$nick\002)" + } } } } -- cgit v1.2.3