PDA

View Full Version : Two internet questions...



R0b0t1
11-09-2007, 11:25 PM
Well, first one is this: Does C++ have a library to interact with HTTP pages? Like SCAR's GetPage function or something?

Second: I once heard there was a program-friendly version of the RS highscores. Where it just had like no HTML or anything...


Yep, thats it. Thanks!

Yakman
11-10-2007, 10:27 PM
i dont think there is a GetPage method, you would probably have to make the whole http interaction with sockets

like in windows, you would use a library called WinSock, then send "GET index.html" to the server, and read to get the html source,

this would be the scar equivalent. (might not compile)


var
socket: Integer;
source: string;

begin
socket:= OpenConnection('www.google.com', 80, 15000);
SendConnectionData(socket, 'GET index.html');
ReadConnectionData(socket, source);
FreeConnection(socket);
writeln(source);
end.


that should work...

R0b0t1
11-11-2007, 03:01 AM
Ok, thanks.


Anyone know if there's a program-friendly RS highscores though?

Method
11-11-2007, 03:11 AM
Ok, thanks.


Anyone know if there's a program-friendly RS highscores though?

Yep, Jagex has conveniently made one for us:

http://hiscore.runescape.com/index_lite.ws?player=UserNameHere

R0b0t1
11-11-2007, 03:47 AM
The freak? How the hell am I supposed to decode that!?!?!

NxTitle
11-11-2007, 03:49 AM
i dont think there is a GetPage method, you would probably have to make the whole http interaction with sockets

like in windows, you would use a library called WinSock, then send "GET index.html" to the server, and read to get the html source,

this would be the scar equivalent. (might not compile)

ScarScript:By Drunkenoldma
var socket: Integer; source: string; begin socket:= OpenConnection('www.google.com', 80, 15000); SendConnectionData(socket, 'GET index.html'); ReadConnectionData(socket, source); FreeConnection(socket); writeln(source); end.

that should work...
It wouldn't work, as you're missing the host name and the HTTP version.

A proper HTTP GET request would look like this:


GET / HTTP/1.0
Host: www.google.ca
User-Agent: Cyber Banana (optional)
(extra line)

Then it would return HTTP headers and the body.

For more info about HTTP, search "rfc 2616" on google. It's kinda complicated, but it's very detailed.

Method
11-11-2007, 03:51 AM
The freak? How the hell am I supposed to decode that!?!?!

Overall Rank, Skill Total, Total Experience, Skill Rank, Skill Level, Skill Experience (and on for the other skills).

NxTitle
11-11-2007, 03:51 AM
The freak? How the hell am I supposed to decode that!?!?!

Well, what I would do is look at zezima's highscore list and match each level with each number. I would be very surprised if they don't have a guide to that, so maybe google will help there.