SRL Archive - Help and Support

Someone help me grab data off a page with Simba?


litoris

2012-09-09 09:36:23

Hey, I want to be ale to get the players online data from the RS homepage. It actually appears on all RS pages(this one is kinds shorter than other pages so it might be better to use), and updates itself every 20 seconds or so I think. I want to log the numbers there into a text document. Can anyone help me with that?

J J

2012-09-09 10:18:54

Some information: http://villavu.com/forum/showthread.php?p=1075545
A start
program New;
{$i SRL/srl.simba}

procedure Test;
var
Text, Players: String;
Position: Integer;

begin
Text := GetPage('http://services.runescape.com/m=friend-referral/splash.ws');
Position := Pos('people', Text);
writeln(Position);
end;


begin
// Setting up Simba
SetupSRL;

// The actual script
Test;
end.

GetPage doesn't get the actual player amount so you would probably have to open the page and then read it as it isn't stored in the GetPage as far as I know :P

Brandon

2012-09-09 10:21:51

You can use a regex. I wrote a semi complete tutorial on that but I can't remember where I placed it lol

litoris

2012-09-09 10:46:42

From: Brandon
You can use a regex. I wrote a semi complete tutorial on that but I can't remember where I placed it lol


Is it this? I'm going for a jog now, will check it out when I'm back.

Daniel

2012-09-10 04:33:57


begin
Writeln('There are:');
Writeln(Between('<div id="PlayerCount"><p class="top"><span>', '</span>', 'http://services.runescape.com/m=friend-referral/splash.ws'));
Writeln('players online.');
end.

litoris

2012-09-10 12:35:03

From: Daniel

begin
Writeln('There are:');
Writeln(Between('<div id="PlayerCount"><p class="top"><span>', '</span>', 'http://services.runescape.com/m=friend-referral/splash.ws'));
Writeln('players online.');
end.


How's that supposed to work?
Getpage doesn't give the number, I read through the string getpage outputs, and it just says 0 for the people online.

masterBB

2012-09-10 12:39:22

It is javascript. You cant grab it.

Bobarkinator

2012-09-10 13:48:11

From: masterBB
It is javascript. You cant grab it.


Unless you executed that javascript.

masterBB

2012-09-10 14:32:30

Can Simba do that?

Bobarkinator

2012-09-10 21:52:00

Not as far as I know. Any service that can give you a web page after the javascript has been executed?

Brandon

2012-09-10 22:52:26

If you can figure out where they grab these links from:

http://www.runescape.com/player_count.js?varname=iPlayerCount&callback=jQuery17206104712865781039_1347331747111&_=1347331787918

or how they're generated then sure you can grab player ID's.

Also note that the part that says: 1347331747111

That increases by 1 every-time the player count changes. Thus if you can find the base value and just keep checking for 404 errors every time you add 1.. Bam player count successful if there are none. Else you need to wait until it updates again and check.

Periodic checks are the only way.

litoris

2012-09-11 10:25:44

From: Brandon
If you can figure out where they grab these links from:

http://www.runescape.com/player_count.js?varname=iPlayerCount&callback=jQuery17206104712865781039_1347331747111&_=1347331787918

or how they're generated then sure you can grab player ID's.

Also note that the part that says: 1347331747111

That increases by 1 every-time the player count changes. Thus if you can find the base value and just keep checking for 404 errors every time you add 1.. Bam player count successful if there are none. Else you need to wait until it updates again and check.

Periodic checks are the only way.


Sorry I didn't understand half of this post, so let me just ask this:
If I did getpage on that link and logged the number between the parentheses every 5 minutes, let's say, that would give me accurate data right? The link will work forever right?

E: Yep, I can just do getpage on the link, and then use between to get the number of players online. If this link works forever, I'm set. I'm trying to make graphs of the amount of people online daily to find optimal times to bot, merch etc.
E': Alright I'm logging data right now, I'll see how that turns out :D