Search YouTube without having to open your browser.
Usage: /youtube
Feel free to edit/change/etc this script.
//server -m irc.swiftirc.net 6667 -j #heharanger
^ my IRC channel if you want
alias yt {
if ($1 != $null) && ($chr(32) isin $1-) {
set %ytsearch $replace($1-,$chr(32),+)
run http://www.youtube.com/results?search_query= $+ %ytsearch
echo -a Searching YouTube for $replace($replace(%ytsearch,$left(%ytsearch,1),$upper($left(%ytsearch,1))),$asc(43),$null) $+ ...
unset %ytsearch
}
if ($1 != $null) && ($chr(32) !isin $1-) {
set %ytsearch $1
run http://www.youtube.com/results?search_query= $+ %ytsearch
echo -a Searching YouTube for $replace($replace(%ytsearch,$left(%ytsearch,1),$upper($left(%ytsearch,1))),$asc(43),$null $+ ...
unset %ytsearch
}
else if ($1 == $null) { echo nothing entered, halting } { halt }
}
space between else and if (Redundant either way)
Ummm, /youtube but the alias is "yt" so shouldn't the trigger be /yt
also got > * Invalid format: $replace (line 230, script7.mrc)
Which is:
echo -a Searching YouTube for $replace($replace(%ytsearch,$left(%ytsearch,1),$upper($left(%ytsearch,1))),$asc(43),$null $+ ...
else if ($1 == $null) { echo nothing entered, halting | halt }
would look nicer as:
elseif (!$1) echo -at No query entered.
you should use /var instead of /set so you don't need to unset it
the first 2 if statements are unneeded as $replace($1-,$chr(32),+) will only change the space character and not any other
else if ($1 == $null) { echo nothing entered, halting } { halt }
should be
else if ($1 == $null) { echo nothing entered, halting | halt }
but the halt is redundant.
alias yt {
var %ytsearch = $replace($1-,$chr(32),+)
if (%ytsearch) { run http://www.youtube.com/results?search_query= $+ %ytsearch }
else { echo -a nothing entered, halting }
}
is a simpler way to do it