Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Habbo Player Class
- *
- * Criado por Drizer
- * Copyright (C) 2011
- */
- class Habbo {
- var $Habbo = NULL;
- var $Hotel = NULL;
- var $HabboId = 0;
- var $JoinDate = 0;
- var $Motto = NULL;
- var $LastLoginTime = 0;
- var $GuestbookId = 0;
- var $Status = NULL;
- public function GetHabboData ($HabboName, $Hotel) {
- if( $HabboName && $Hotel ) {
- $this->Habbo=$HabboName;
- $this->Hotel=$Hotel;
- $ReturnData = file_get_contents("http://www.habbo.".$Hotel."/home/".$HabboName);
- if($ReturnData) {
- preg_match_all("#class=\"profile-motto\">\n(.*?)\n#i",$ReturnData,$Motto);
- preg_match_all("#class=\"birthday date\">\n(.*?)\n#i",$ReturnData,$JoinDate);
- preg_match_all("#initView\((.*?),#i",$ReturnData,$HabboId);
- $Motto = $Motto[1]; $Motto = trim($Motto[0]);$this->Motto = $Motto;
- $JoinDate = $JoinDate[1]; $JoinDate = trim($JoinDate[0]); $this->JoinDate = $JoinDate;
- $HabboId = $HabboId[1]; $HabboId = $HabboId[0]; $this->HabboId=$HabboId;
- if(strstr($ReturnData,"var gb")) {
- preg_match_all("#var gb(.*?) #i",$ReturnData,$Gid);
- $Gid = $Gid[1][0];
- $this->GuestbookId=$Gid;
- } else {
- $this->GuestbookId="N/D";
- }
- if(strstr($ReturnData,"habbo_offline.gif")) {
- $this->Status = "OFFLINE";
- } else {
- $this->Status = "ONLINE";
- }
- $lastStamp = file_get_contents("http://www.habbo.com.br/habblet/habbosearchcontent?searchString=$HabboName");
- preg_match_all("#<span title=\"(.*?)\">#i",$lastStamp,$lastStamp);
- $this->LastLoginTime=$lastStamp[1][0];
- } else {
- return NULL;
- }
- } else {
- return NULL;
- }
- }
- }
- $Habbo = new Habbo;
- $Habbo->GetHabboData("BadRequest!","com.br");
- print_r($Habbo);
- //para ler um atributo especifico $Habbo->[Nome do Atributo]
- ?>
Advertisement
Add Comment
Please, Sign In to add comment