mIRC Home    About    Download    Register    News    Help

Print Thread
#46319 01/09/03 10:14 PM
R
realillusion
realillusion
R
Would it be possible to read the contents of an iexplore web page using DDE? Like, suppose I wanted to make a script to pull a definition off of www.dictionary.com... something like:

alias /def {
/dde iexplore WWW_OpenURL http://dictionary.reference.com/search?q= $+ $replace($1-,$chr(32),% $+ 20)
}

That would OPEN the page, right? How could I read its contents, though?

#46320 01/09/03 10:46 PM
Joined: Jul 2003
Posts: 733
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
dde? no..i think u want sockets... /help sockets smirk

#46321 01/09/03 11:14 PM
R
realillusion
realillusion
R
Yeah, well, I don't know much of anything about sockets.

I read the help section (not the first time I've read it, either) but I don't really know how to use this to do what I want. I would guess the first step is to use /sockopen to connect to... my own computer, on any port. Then what? I guess I use /sockwrite to send info to that connection, but what info do I send? Should I be sending something like /sockwrite (name) run iexplore...?

I think it's pretty clear I don't know what I'm doing, especially when it comes to sockets. :-D

#46322 02/09/03 04:48 AM
T
theRat
theRat
T
No no no....
You connect to the server where you want the info to be retrieved...

try using the search function of these boards, and you'll find many examples how to do that...

#46323 02/09/03 05:47 AM
D
demitrix
demitrix
D
Code:
 
alias dict {
  %string = $replace($1-,$chr(32),+)
  sockopen DICT dictionary.com 80
}
on *:SOCKOPEN:DICT:{
  sockwrite -n $sockname GET /search?q= $+ %string
  sockwrite -n $sockname Host: dictionary.com.org $+ $crlf $+ $crlf
}
on *:SOCKREAD:DICT:{
  if ($sockerr) {
    echo -a Error!
  }
  else {
    var %socktext
    sockread %socktext
    if (<TABLE>* $+ $replace(%string,+,$chr(32)) $+ * iswm %socktext) {
      echo -a $left($htmlfree(%socktext),$len(%string))
    }
    if (<OL><LI> isin %socktext) {
      commands to get definition out of HTML
    }
  }
}
alias htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
  return %x
}
 

something along thoes lines
im my AIM... demitrixrd
and ill help you out if u dont get it

Last edited by demitrix; 02/09/03 05:49 AM.

Link Copied to Clipboard