Any chance of some more samples of pages with data pulled from the api? Like how many people are currently connected, what tournaments are available, who is currently winning the tournament? Stuff like that would be great to have shown on the site, it would encourage more people to play I would hope.
I would be looking long term to add each players stats from the Poker into their vBulletin profile page, that would be a great addition.
I have so far made a page the show the chipleaders, I just need more info of how they all work and maybe I can then start using chunks from each one to create a page with all the data I need on it.
Cheers Kent, and thanks for the great work.
Request
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Request
<?phpMonTheHoops wrote:Like how many people are currently connected
include "API.php";
$params = "Password=" . $pw . "&Command=ConnectionsList";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
echo "The number of connections is " . $api["Connections"];
?>
<?phpwhat tournaments are available
include "API.php";
$params = "Password=" . $pw . "&Command=TournamentsList&Fields=Name,BuyIn,Status";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
$n = $api["Tournaments"];
echo "<b>Tournaments Available</b><br>";
for($i=1;$i<=$n;$i++) echo $api["Name".$i] . " - " . $api["BuyIn".$i] . " - " . $api["Status".$i] . "<br>";
?>
<?phpwho is currently winning the tournament?
include "API.php";
$tname = "Tournament #1";
$params = "Password=" . $pw . "&Command=TournamentsPlaying&Name=" . urlencode($tname);
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
if (isset($api["Rank1"])) echo "Chip leader for " . $tname . " is " . $api["Player1"] . " (" . $api["Chips1"] . ")";
else echo $tname . " is not running";
?>
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Request
FYI, the contents of API.php are listed here:
http://www.briggsoft.com/forums/viewtop ... t=114#p563
http://www.briggsoft.com/forums/viewtop ... t=114#p563
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Request
Cheers Kent, I'm being greedy now, can this also list the current people connected by username?
Cheers.
Cheers.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Request
Just add a Fields=Player parameter to the ConnectionsList command as documented in the help file. Then loop through the results like was done with the tournament listing example and display $api["Player".$i]. You should check for blank values which indicate a connection made but the player not yet logged in. Something like this:MonTheHoops wrote:Cheers Kent, I'm being greedy now, can this also list the current people connected by username?
<?php
include "API.php";
$params = "Password=" . $pw . "&Command=ConnectionsList&Fields=Player";
$api = Poker_API($url,$params);
if ($api["Result"] == "Error") die("Error: " . $api["Error"]);
$n = $api["Connections"];
echo "<b>Players Logged In</b><br>";
$logins = 0;
for($i=1;$i<=$n;$i++) if($api["Player".$i] <> "")
{
echo $api["Player".$i] . "<br>";
$logins++;
}
echo "<b>Total: </b>" . $logins;
?>
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Request
That seems to throw up an error message of:
Error: SessionID not found
Did I miss something?
Error: SessionID not found
Did I miss something?
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Request
Ignore above, my fault.
I used ConnectionsGet instead of ConnectionsList
This is hard work, I'm no serious coder
I used ConnectionsGet instead of ConnectionsList
This is hard work, I'm no serious coder
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Request
Are you using ConnectionsGet instead of ConnectionsList?MonTheHoops wrote:That seems to throw up an error message of:
Error: SessionID not found
Did I miss something?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Request
Your post beat me by 1 minute.
-
- Posts: 48
- Joined: Sat Jun 21, 2008 3:39 pm
Re: Request
Will the API allow access to the logfiles?
For instance is it capable of listing previous results in tournaments or ring games?
Can it show who has won the most tournaments?
Cheers Kent
For instance is it capable of listing previous results in tournaments or ring games?
Can it show who has won the most tournaments?
Cheers Kent