From 93e335a60696a94cbfc54b2b94d3221f75f21224 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 27 Oct 2010 20:48:36 -0400 Subject: [PATCH] Also parse out spaces for YouTube videos --- handler.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/handler.go b/handler.go index 286f8c7..7bb2f18 100644 --- a/handler.go +++ b/handler.go @@ -57,11 +57,8 @@ func handlePrivmsg(conn *irc.Conn, line *irc.Line) { video = line.Text[27:] } if video != "" { - if amp := strings.Index(video, "&"); amp > -1 { - video = video[0:amp] - } - if pound := strings.Index(video, "#"); pound > -1 { - video = video[0:pound] + if end := strings.IndexAny(video, " &#"); end > -1 { + video = video[0:end] } youtube(conn, nick, video, target) } else {