YouTube Search

By icedtaa on Dec 26, 2009

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 }   
}

Comments

Sign in to comment.
DiRtDoG   -  Feb 07, 2010

Anyway of having this search output on IRC if !youtube all the one's I seen don't work.

Never mind found another script Youtube advanced search that does it.

 Respond  
Silo   -  Dec 28, 2009

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. 
 Respond  
sunslayer   -  Dec 27, 2009

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

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.