mIRC Home    About    Download    Register    News    Help

Print Thread
#119126 01/05/05 07:55 PM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
Ok guys, I made this online radio player so I can play radio stations in mIRC and it works with no problems but I'm having problems with one area now... getting it to advertise the song that is currently playing from the radio. I know, everyone is thinking I can't do it but there has to be some sort of way to be able to get it done because the radio station shows the Now Playing song on it's site. Below is the code I currently have and feel free to tell me about any code that would maybe make it a better player.

Code:
dialog online_radio {
  title "Online Radio"
  size -1 -1 155 22
  option dbu
  box "", 1, 3 0 149 19
  combo 2, 42 6 60 87, size drop
  button "4", 3, 105 6 20 10
  text "Radio", 4, 6 6 33 8, disable center
  button "<", 5, 128 6 20 10
}

on *:dialog:online_radio:init:*:{
  $mdx SetMircVersion $version 
  $mdx MarkDialog $dname
  $mdx SetFont 3,5 18 700 webdings
  $mdx SetFont 4 18 600 Dungeon
  $dll(system\dlls\VStyle.dll,NoTheme,$dialog($dname).hwnd)
  did -a online_radio 2 HitzRadio
  did -c online_radio 2 1
}
on *:dialog:online_radio:sclick:3:{
  if ($did(2) == HitzRadio) { runRP http://205.188.234.38:8070/ | kte_echo -a Hitz Radio }
}
on *:dialog:online_radio:sclick:5:{
  /ClosePlayers
}

alias runRP {
  if !$1 {
    echo -aec info * /runRP: insufficient parameters.
    return
  }
  if !$com(objRP) {
    if $com(objWMP) { closeWMP }
    .comopen objRP rmocx.RealPlayer G2 Control.1
    if $comerr {
      echo -aec info * /runRP: incompatible RealPlayer version.
      return
    }
  }
  else !.echo -q $com(objRP,DoStop,1)
  !.echo -q $com(objRP,Source,4,bstr,$1-)
  !.echo -q $com(objRP,DoPlay,1)
}

alias -l closeRP .comclose objRP

alias closePlayers {
  if $com(objRP) { closeRP }
}


Any help with this is greatly appreciated. Oh and the website that has the Now Playing info is HitzRadio.com

#119127 02/05/05 07:06 AM
Joined: Dec 2004
Posts: 12
V
Pikka bird
Offline
Pikka bird
V
Joined: Dec 2004
Posts: 12
you might need to open a socket to read the np data from the website.. but it wouldnt pick up every time the song changes so you'd have to do it manually when you want it to advertize, either with a timer or a !command or whatever.

this works for me...
Code:
alias adv_rp {
  sockopen advrp www.hitzradio.com 80
}
on *:sockopen:advrp:{
  sockwrite -tn $sockname GET / http/1.1 $+ $crlf $+ User-Agent: radioplayer (compatible; MSIE 6.0; Windows NT 5.1) $+ $crlf $+ Host: www.hitzradio.com $+ $crlf $+ Connection: Close $+ $crlf $+ $crlf
}
on *:sockread:advrp:{
  var %s | sockread %s
  if (*<span id="nowplaying">* iswm %s) echo 4 -a * radioplayer: now playing: $gettok($gettok(%s,3,62),1,60)
}

#119128 02/05/05 11:32 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
heh, this is great it atleast works. Thanks for the input and the code. I'll mess with it a bit and see if I can't get it to update and advertise automatically but atleast I know I'm not going to be wasting my time trying to get something to work that just isn't going to. Once again thankyou.


Link Copied to Clipboard