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?
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
~Hermen
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
~Hermen
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?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?
Send SMS messages using Simba
Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!
He just wants to print the online players on a HTML page...
Not that hard in PHP.![]()
The best way to contact me is by email, which you can find on my website: http://wizzup.org
I also get email notifications of private messages, though.
Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
Documentation | Source | Simba Bug Tracker on Github and Villavu )
My (Blog | Website)
There are currently 1 users browsing this thread. (0 members and 1 guests)