Apr 02, 2009
Technical Support Representative
United States

Activity Stream

nettocash commented on a Page, VLC Now Playing  -  Feb 15, 2013

I've been using aimp tools with winamp to display mp3s with mirc, but i'm on linux now, and vlc was already installed, and i'm too lazy to even see if winamp is supported by linux so I just googled for vlc mirc mp3 player. I ended up here, but the above code didn't work for me, so I had to do a little coding of my own to make it work, and this is what I came up with....

displays on irc like this when you type /vlc

(10:55a|2/15) * ~nettocash np: Franz Ferdinand - Take Me Out [181.FM - The Buzz (Your Alternative Station!)]
(11:04a|2/15) * ~nettocash np: Live - Lightning Crashes [181.FM - The Buzz (Your Alternative Station!)]
(11:05a|2/15) * ~nettocash np: Imagine Dragons - Radioactive [181.FM - The Buzz (Your Alternative Station!)]

what I put in mirc remote editor

alias vlc { 
  if (!$sock(vlc)) {
    sockopen vlc 8080
    sockmark vlc $iif($1 == echo,echo -a,describe $active)
on *:sockopen:vlc:{
  sockwrite -nt vlc GET /requests/status.xml HTTP/1.1
  sockwrite -nt vlc Host: $str($crlf,2)
on *:sockread:vlc:{
  if ($sockerr) { echo -a Error: $sock(vlc).wsmsg }
  window -hde @ $+ $sockName -1 -1 500 500
  var %v
  sockread %v
  aline -p @ $+ $sockName : $+ %v
  if (<state>stopped</state> isin %v || <state>paused</state> isin %v ) { echo -a Error: Not playing any songs! | sockclose vlc }
  else {
    if ($regex(%v,/<(length)>([^>]+)<\/length>/)) { set %v. $+ $left($regml(1),2) $hf($regml(2)) }
    if ($regex(%v,/<info name='title'>([^>]+)<\/info>/i)) { set %v.title $regml(1),2) }
    if ($regex(%v,/<info name='now_playing'>([^>]+)<\/info>/i)) { set $regml(1),2)  }
    if (</root> isin %v) { 
      $sock(vlc).mark np: $chr(91) $+ %v.title $+ $chr(93) 
      unset %v.*
      sockclose vlc
      window -c @vlc

alias -l hf { return $remove($replace($1-,&quot;,",&apos;,',&amp;,&,&lt;,<,&gt;,>,&nbsp;,$chr(32),&#39;,'),<![CDATA[,]]>) } 

I'm using VLC 2.0.4 TwoFlower, dont forget to add "web interface" like the original author stated in the first post. good luck

also, thanks to the two guys who coded most of this script!!! much appreciate it

nettocash created a Page  -  Apr 02, 2009

Just something I put together when bored one day for a friend who owns a soccer channel. Someone else might find this useful too so I figured I'd post it.

 Respond   mIRC  
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.