mIRC Home    About    Download    Register    News    Help

Print Thread
#107343 08/01/05 10:15 PM
Joined: Sep 2003
Posts: 7
P
pjlion Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Sep 2003
Posts: 7
hi,
can anybody help me i would like to make a script making it possible to get information from a website (http://www.vandale.nl/opzoeken/woordenboek/ ) in the bodem off that page you have a field where you can enter the search term but how to get the information it displays? and how to use it in to my channel?
help would be welcome...
thx in advance
pjlion


when nothing else matters but irc
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I have started you off, you will need to get some tutorials to go more in-depth.

Hope this helps.
Type /tran <word>

Code:
alias tran { 
  sockopen tran www.vandale.nl 80 
  set %zoekwoord $1
}

on 1:sockopen:tran: { 
  sockwrite -n $sockname GET /opzoeken/woordenboek/?zoekwoord= $+ %zoekwoord HTTP/1.0
  sockwrite -n $sockname Host: www.vandale.nl
  sockwrite -n $sockname Connection: keep-alive
  sockwrite $sockname $crlf
} 

alias -l nohtml {
  var %x, %i = $regsub($1-,/(^[^&lt;]*&gt;|&lt;[^&gt;]*&gt;|&lt;[^&gt;]*$)/g,$null,%x), %x = $remove(%x,&amp;nbsp;)
  return %x
} 

on 1:sockread:tran: {
  if ($sockerr &gt; 0) return
  :nextread
  sockread %tran
  if ($sockbr == 0) { 
    return
  }
  if (RESULTAAT isin %tran) { 
    echo -a $nohtml(%tran) 
  }
  if (%zoekwoord isin %tran) { 
    echo -a $nohtml(%tran)
  }
  if (U hebt gezocht op isin %tran) { 
    echo -a RESULTAAT: 0  
  }
  goto nextread
}

Last edited by SladeKraven; 09/01/05 07:23 AM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
If using that code, take out this part..
Code:
  if (U hebt gezocht op isin %tran) { 
    echo -a RESULTAAT: 0  
  }

I thought that means 0 result but I get it in whatever I define. My sincere apologies..

Edit: Also, that nohtml alias was not coded by me I did a search, I think you can take out the %i variable. I don't see where it is being used at all.

Last edited by SladeKraven; 09/01/05 05:24 PM.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)

The reason for the %i variable is simply to give the regsub a way to be evaluated. The %i is not the important part here, the $regsub is.

He can't take the %i away, since that would mean the regsub isn't evaluated anymore, and it's the core of the alias. What he however could do is the following:

var %x
!.echo -q $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x)
%x = $remove(%x,&nbsp;)

If not, then he should let the %i var stay.

Greets


Gone.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ah right. Cheers. smile


Link Copied to Clipboard