I need something like a RuneScape Online Players grabber, but I need to grab the amount of posts a thread has on a certain forum...Any help?
Printable View
I need something like a RuneScape Online Players grabber, but I need to grab the amount of posts a thread has on a certain forum...Any help?
why php, just use a scar script?
yeah use srl, this function is special for it
StatsGrabberMAdeForelkins;
try it maybe... xD
SCAR Code:procedure StatsGrabberMadeForElkins;
var
PageContent: string;
begin
PageContent := GetPage('http://www..com');
PageContent := Between('somthing', 'sonthing', PageContent);
Writeln(PageContent);
end;
I want to echo it onto the page via HTML is why...
I'm not a good PHP scripter...I want a page that grabs a simple post number and echoes it...
EDIT: Timer, for between in SCAR, does it mean between the html code? or just the shown text.?
between...
SCAR Code:begin
Writeln(getpage('http://www..com');
end.
-.- You didn't answer my question. Does it retrieve what is between the visible text on that page, or between the HTML code inside it.
idk, just run that, you'll see!! lol
Ok, so now I have it to where it retrieves the stuff...But now I need to make it into a website...
dude this SRL-FORUMS not CRAZY-ELKINS IDEA FORUMS
It's also a request forum. I don't admire your post.
Well.. I would help, but I don't exactly know what you need.
So you need something like the echo(); command?Quote:
Ok, so now I have it to where it retrieves the stuff...But now I need to make it into a website...
or just you need to know how to setup a webpage with php?
I need to know how to make PHP grab text between two words on a website, and echo them.
Ah.. ok, well I have a function for that already:
PHP Code:function str_between($str, $betw, $betw2)
{
$str = " " . $str;
$pos = strpos($str, $betw);
if ($pos > 0)
{
$str2 = substr($str, $pos + strlen($betw));
$pos2 = strpos($str2, $betw2);
if ($pos2 == 0)
return '';
return substr($str2, 0, $pos2);
}
else
{
return '';
}
}
Would this work then?:
PHP Code:<?php
function str_between($str, $betw, $betw2)
{
$str = " " . $str;
$pos = strpos($str, $betw);
if ($pos > 0)
{
$str2 = substr($str, $pos + strlen($betw));
$pos2 = strpos($str2, $betw2);
if ($pos2 == 0)
return '';
return substr($str2, 0, $pos2);
}
else
{
return '';
}
}
$users = str_between('http://srl-forums.com/forum/','<a href="online.php" rel="nofollow">','<a href="online.php" rel="nofollow">Currently Active Users</a>','</div></div>');
echo $users;
?>
That wouldn't... you have to do a file_get_contents to get a webpage.
I tested this, and it works:
PHP Code:<?php
function str_between($str, $betw, $betw2)
{
$str = " " . $str;
$pos = strpos($str, $betw);
if ($pos > 0)
{
$str2 = substr($str, $pos + strlen($betw));
$pos2 = strpos($str2, $betw2);
if ($pos2 == 0)
return '';
return substr($str2, 0, $pos2);
}
else
{
return '';
}
}
$site = file_get_contents('http://srl-forums.com/forum/');
$users = str_between($site, 'Currently Active Users</a>:', '
</td>');
echo $users;
?>
Gravedig, sorry, my post is worth it ;)
Botmaster has a player grabber, check it out - is that what you mean?
He just wants to print the online players on a HTML page...
Not that hard in PHP. :)