mIRC Home    About    Download    Register    News    Help

Print Thread
#48521 10/09/03 06:19 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
i got a little problem with retreiving a webpage via mirc to be parsed after its finished downloading.

when i try having mirc retreive the page, it keeps saying site not found, but when i take the URL and put it into IE, it goes right to the page. the code follows.

Code:
alias amg {
  if (artist iswm $1) { set %type 1 }
  elseif (album iswm $1) { Set %type 2 }
  elseif (song iswm $1) { Set %type 3 }
  elseif (styles iswm $1) { Set %type 5 }
  elseif (label iswm $1) { Set %type 4 }
  set %query $2-
  sockopen amg allmusic.com 80
}

on *:sockopen:amg:{
  sockwrite -n $sockname GET $+(/cg/amg.dll?p=amg&opt1=,%type,&sql=,%query) HTTP/1.0
  echo -s attemping to open a connection to $+(http://www.allmusic.com,$+(/cg/amg.dll?p=amg&opt1=,%type,&sql=,%query))
  sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
  echo -a User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname Accept */*
  sockwrite -n $sockname Host: allmusic.com
  sockwrite -n $sockname $crlf
}

on *:sockread:amg:{
  sockread %amg-temp
  window -k @AMG_PARSER
  aline @AMG_PARSER %amg-temp
  echo -a Bytes Sent so far:  $sock(amg).rcvd
}

its supposed to connect to allmusic and retreive the info of the song/album/artist/lable/or style .. i know i got the url right, cause it works in IE, just cant get mirc to use socket on it and put it into a @window.


if yall could lookie over my code, i would appreciate it and tell me what i screwed up smile

====
edit: fixed a small typo, still dont work

Last edited by keeker; 10/09/03 06:48 PM.

keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
#48522 10/09/03 07:39 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
What command do you use to trigger this? I can't find a URL that matches your query by using the search feature on that site.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#48523 10/09/03 09:18 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname Host: www.allmusic.com

#48524 10/09/03 09:31 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
the url does not show in the address bar, i got it from viewing the souce code for the front page in notepad.


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
#48525 10/09/03 09:32 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
thank you online, its working now, just have to figgure out why it keeps saying "/aline: line too long" when i run it


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
#48526 11/09/03 03:59 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Because the line is too long. mIRC has a limited length available for variables (name + value = max 945 characters)


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius

Link Copied to Clipboard