Skip to content

Instantly share code, notes, and snippets.

@elig0n
Last active September 5, 2022 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elig0n/c0d6e6f3090630823e54e23b90779179 to your computer and use it in GitHub Desktop.
Save elig0n/c0d6e6f3090630823e54e23b90779179 to your computer and use it in GitHub Desktop.
mIRC VLC now playing
alias np {
sockclose vlc
sockopen vlc localhost 8080
}
on *:sockopen:vlc:{
if $sockerr > 0 { echo -at vlc not running | sockclose vlc }
sockwrite -n $sockname GET /requests/status.xml HTTP/1.1
sockwrite -n $sockname Host: localhost
sockwrite -n $sockname Authorization: Basic $encode(:XXX,m) ; password comes after colon
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname $crlf
echo -at %vlcx
}
on *:sockread:vlc: {
if $sockerr > 0 { echo -a error | sockclose vlc }
sockread %vlcx
if ($regex(%vlcx,<info name='title'>(.*?)</info>)) {
set %title $regml(1)
}
if ($regex(%vlcx,<info name='artist'>(.*?)</info>)) {
set %artist $regml(1)
}
if ($regex(%vlcx,<info name='Bitrate'>(.*?)</info>)) {
set %bitrate $regml(1)
}
if ($regex(%vlcx,<length>(.*?)</length>)) {
set %length $regml(1)
}
if (</root> iswm %vlcx) {
msg $active is now Playing: %artist - %title @ %bitrate Length: $duration(%length)
unset %artist %title %bitrate %vlcx %length
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment