Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement