Top

ShoutCast (socket only)


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  May 20, 2009
Last Updated  May 20, 2009
Tags  music  radio  shoutcast  sockets  stream  web 

Description

I only added the socket part here. But it should give you a pretty good idea on how to manipulate it to work the way you want it to.

make all the action happen inside on *:sockclose:ShoutCast: :)

Grab the Code

on *:sockopen:ShoutCast: {
  sockwrite -n $sockname GET /7.html HTTP/1.0
  sockwrite -n $sockname User-Agent: SHOUTcast Song Status (Mozilla  Compatible)
  sockwrite -n $sockname Host: $+(%sc.server,:,%sc.port)
  sockwrite -n $sockname Connection: keep-alive
  sockwrite -n $sockname $crlf
}
on *:sockread:ShoutCast: { 
  sockread -fn &bin 
  set %sc.all $bvar(&bin,1,150).text
  set %sc.info $remove(%sc.all,<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>,</body></html,>)
  set %sc.listen $gettok(%sc.info,1,44)
  set %sc.max $gettok(%sc.info,4,44)
  set %sc.peak $gettok(%sc.info,3,44)
  set %sc.kbps $gettok(%sc.info,6,44)
  set %sc.unique $gettok(%sc.info,5,44)
  set %sc.playing $gettok(%sc.info,7-,44)
  halt
}

Comments

  (1)  RSS
knoeki
Comments: 142
 
mIRC Snippet:  ShoutCast (socket only)
Posted on Jul 17, 2009 4:26 am
Awesome! this helped me a lot :_)

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom