mIRC Home    About    Download    Register    News    Help

Print Thread
#46319 01/09/03 10:14 PM
Joined: Aug 2003
Posts: 3
R
Self-satisified door
OP Offline
Self-satisified door
R
Joined: Aug 2003
Posts: 3
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: 742
Hoopy frood
Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
dde? no..i think u want sockets... /help sockets smirk


http://MTec89Net.com
irc.freenode.net #MTec89Net
#46321 01/09/03 11:14 PM
Joined: Aug 2003
Posts: 3
R
Self-satisified door
OP Offline
Self-satisified door
R
Joined: Aug 2003
Posts: 3
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
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
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...


Code:
//if ( khaled isgod ) echo yes | else echo no
#46323 02/09/03 05:47 AM
Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67
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.

while (demi == nub) {
inc %skill
}

Link Copied to Clipboard