mIRC Home    About    Download    Register    News    Help

Print Thread
Socket downloads .php file only half. #100722 15/10/04 05:52 PM
Joined: Aug 2004
Posts: 7
TheCat Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Aug 2004
Posts: 7
I'm making a script to search for profiles on a livejournal kind of site. There is a .php script on the server for scripts, which has a format like this:

# "nr of nicks"
<br>nick<br>nick<br>nick<br>...

I'm reading this file with a simple socket read, i let it read the line to a %var and then write the %var to a .txt file.
But when I check the text file, I only see the http info, the # nr, and then it stops. When I check the var, it has the # line in it.

Any idea on solving this? Here's the script: (I'm using a dialog to get the search terms in variables, but I've checked that, it works. The number of found nicks is also > 0. It opens the socket once all the vars have been set.)

Code:
 on *:sockopen:Noxazoek: {
  sockwrite -n $sockname GET /_dump/profielzoek1.php?&amp;functie=zoekprofiel&amp;zoekleeftijdmin= $+ %minage $+ &amp;zoekleeftijdmax= $+ %maxage $+ &amp;zoeklocatie= $+ %woonplaats $+ &amp;zoekstatus= $+ %status $+ &amp;zoekgeslacht= $+ %geslacht HTTP/1.1
  sockwrite -n $sockname Host: www.noxa.net $+ $crlf $+ $crlf
}
on *:sockread:Noxazoek: {
  sockread %zoek
  write Noxa\profielzoek.txt %zoek
} 


(Just a simple, regular socket script as you can see.)


-----------------

A shotgun is always the answer.
Re: Socket downloads .php file only half. #100723 16/10/04 01:39 PM
Joined: Aug 2004
Posts: 7
TheCat Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Aug 2004
Posts: 7
anyone? ^^;


-----------------

A shotgun is always the answer.
Re: Socket downloads .php file only half. #100724 16/10/04 05:12 PM
Joined: Aug 2004
Posts: 7
TheCat Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Aug 2004
Posts: 7
I made a loop for the read, because lines in a php file don't end in a $crlf, and it works now, but the second line is usually too long

any ideas on how to seperate it?

Edit: I tried replacing the <br> by a space or a comma. It works, but sometimes the <br> gets seperated over two lines, and not replace or one of the nicks gets seperated over two lines, which would make it kind of impossible to /echo correctly. Help?

Last edited by TheCat; 16/10/04 05:23 PM.

-----------------

A shotgun is always the answer.
Re: Socket downloads .php file only half. #100725 17/10/04 01:28 AM
Joined: Dec 2002
Posts: 7
D
Davman Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
D
Joined: Dec 2002
Posts: 7
If you specify the -f switch with a %var variable, this forces mIRC to fill the %var variable with whatever text is in the receive buffer, even if it doesn't end in a $crlf.

Possibly do that instead of splitting.

Re: Socket downloads .php file only half. #100726 17/10/04 06:43 AM
Joined: Aug 2004
Posts: 7
TheCat Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Aug 2004
Posts: 7
I did, and now it reads everything to the txt file

But how do I get it to not split the lines at random points?


-----------------

A shotgun is always the answer.
Re: Socket downloads .php file only half. #100727 17/10/04 02:50 PM
Joined: Aug 2004
Posts: 7
TheCat Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Aug 2004
Posts: 7
Never mind, I got a solution.

I halt the script if there is more than one line of nicks.


-----------------

A shotgun is always the answer.