├── src
├── House.php
├── World.php
├── Guild.php
└── Character.php
├── examples
├── isOnline.php
└── VIPList.php
└── README.md
/src/House.php:
--------------------------------------------------------------------------------
1 | isOnline();
6 | ?>
7 |
8 |
9 |
10 |
11 | Is player online?
12 |
13 |
17 |
18 |
19 | Is = $_GET['name'] ?> online?
20 | = $_GET['name'] ?> is = $isOnline ?>
21 |
22 |
--------------------------------------------------------------------------------
/examples/VIPList.php:
--------------------------------------------------------------------------------
1 | array(),
12 | "offline" => array()
13 | );
14 |
15 | foreach($vip as $playerName) {
16 | $player = new Tibia\Player($playerName);
17 | if($player->isOnline() === "Online") {
18 | $status['online'][] = $playerName;
19 | } else {
20 | $status['offline'][] = $playerName;
21 | }
22 | }
23 |
24 | ?>
25 |
26 |
27 |
28 |
29 | Is player online?
30 |
31 |
35 |
36 |
37 | VIP
38 |
39 |
40 | - = $name ?>
41 |
42 | - = $name ?>
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/Character.php:
--------------------------------------------------------------------------------
1 | loadHTMLFile("https://www.tibia.com/community/?subtopic=characters&name=" . urlencode($name));
35 |
36 | $tables = $dom->getElementsByTagName('table');
37 |
38 | $this->name = $tables[1]->childNodes[1]->textContent;
39 | $this->title = $tables[1]->childNodes[3]->textContent;
40 |
41 | echo "Name: " . $this->name . "\n";
42 | echo "Title: " . $this->title . "\n";
43 | }
44 | }
45 |
46 | $char = new Character('Kamerat');
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Tibia Website API
2 | ====================
3 |
4 | Test
5 | This is a simple PHP class to extracting information from the official Tibia website (http://www.tibia.com)
6 |
7 | Methods
8 | ------------------
9 | **Player**
10 | - getOtherChars() : *Returns an array of other listed chars if any. False if not.*
11 | - getDeaths() : *Returns an array of deaths if any listed. False if not.*
12 | - isOnline($alt = array('Online', 'Offline')) : *Check wether the person is online or offline.*
13 |
14 | **Guild**
15 | - getMembers() : *Returns an array of members.*
16 |
17 | Properties
18 | -------------------
19 | **Player**
20 | - $name
21 | - $sex
22 | - $vocation
23 | - $level
24 | - $points : *Achievment Points*
25 | - $world
26 | - $formerWorld
27 | - $city
28 | - $house
29 | - $guild
30 | - $lastLogin
31 | - $comment
32 | - $status : *Account status (Free account | Premium account)*
33 | - $created
34 |
35 | **Guild**
36 | - $name
37 | - $description
38 | - $founded
39 | - $guildHall
40 |
41 | Usage
42 | ----------------
43 | Include the class
44 |
45 | include_once "TibiaWebAPI.class.php";
46 |
47 | Initiate a player object
48 |
49 | $player = new Tibia\Player("Player Name");
50 |
51 | Initiate a guild object
52 |
53 | $guild = new Tibia\Guild("Guild name");
54 |
--------------------------------------------------------------------------------