Hi,
I'm trying to retrieve some info from a website, thru sockets. I'm no expert in this, but i do have searched and tried alot of combinations, but i simply can't get it to work.
The goal is, to retrieve only one line, from a page like this:
http://www.clanbase.com/cbrank.php?cid=113892&lid=2398&type=js(The &type=js is optional).
So far, i've came only to 'debugging', and this is what i came up with:
alias cb.rank {
if ($sock(cbrank)) { sockclose cbrank }
sockopen cbrank www.clanbase.com 80
}
on *:sockopen:cbrank:{
sockwrite -t cbrank GET cbrank.php?cid=113892&lid=2398&type=js HTTP/1.0
sockwrite -n cbrank Host: www.clanbase.com 80
sockwrite -n cbrank $crlf
}
on *:sockread:cbrank:{
sockread %vrs
echo -a :: %vrs
}
And this is what it returns:
:: HTTP/1.1 400 Bad Request
:: Date: Mon, 26 Mar 2007 18:22:38 GMT
:: Server: Apache/1.3.37 (Unix) PHP/4.4.2
:: Connection: close
:: Content-Type: text/html; charset=iso-8859-1
::
:: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
:: <HTML><HEAD>
:: <TITLE>400 Bad Request</TITLE>
:: </HEAD><BODY>
:: <H1>Bad Request</H1>
:: Your browser sent a request that this server could not understand.<P>
:: The request line contained invalid characters following the protocol string.<P>
:: <P>
:: </BODY></HTML>
I really have no clue what to change, to make it work. While it just should return "document.write(3)" in this case.