nPhoenix

Pegar infos do Habbo.

Feb 13th, 2012
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.29 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * Habbo Player Class
  5.  *
  6.  * Criado por Drizer
  7.  * Copyright (C) 2011
  8. */
  9.  
  10. class Habbo {
  11.     var $Habbo           = NULL;
  12.     var $Hotel           = NULL;
  13.     var $HabboId         = 0;
  14.     var $JoinDate        = 0;
  15.     var $Motto           = NULL;
  16.     var $LastLoginTime   = 0;
  17.     var $GuestbookId     = 0;
  18.     var $Status          = NULL;
  19.      
  20.     public function GetHabboData ($HabboName, $Hotel) {
  21.         if( $HabboName && $Hotel ) {
  22.             $this->Habbo=$HabboName;
  23.             $this->Hotel=$Hotel;
  24.             $ReturnData = file_get_contents("http://www.habbo.".$Hotel."/home/".$HabboName);
  25.             if($ReturnData) {
  26.                 preg_match_all("#class=\"profile-motto\">\n(.*?)\n#i",$ReturnData,$Motto);
  27.                 preg_match_all("#class=\"birthday date\">\n(.*?)\n#i",$ReturnData,$JoinDate);
  28.                 preg_match_all("#initView\((.*?),#i",$ReturnData,$HabboId);
  29.                 $Motto = $Motto[1];    $Motto = trim($Motto[0]);$this->Motto = $Motto;
  30.                 $JoinDate = $JoinDate[1]; $JoinDate = trim($JoinDate[0]); $this->JoinDate = $JoinDate;
  31.                 $HabboId = $HabboId[1]; $HabboId = $HabboId[0]; $this->HabboId=$HabboId;
  32.                 if(strstr($ReturnData,"var gb")) {
  33.                     preg_match_all("#var gb(.*?) #i",$ReturnData,$Gid);
  34.                     $Gid = $Gid[1][0];
  35.                     $this->GuestbookId=$Gid;
  36.                 } else {
  37.                     $this->GuestbookId="N/D";
  38.                 }
  39.                 if(strstr($ReturnData,"habbo_offline.gif")) {
  40.                     $this->Status = "OFFLINE";
  41.                 } else {
  42.                     $this->Status = "ONLINE";
  43.                 }
  44.                 $lastStamp = file_get_contents("http://www.habbo.com.br/habblet/habbosearchcontent?searchString=$HabboName");
  45.                 preg_match_all("#<span title=\"(.*?)\">#i",$lastStamp,$lastStamp);
  46.                 $this->LastLoginTime=$lastStamp[1][0];
  47.                  
  48.             } else {
  49.                 return NULL;
  50.             }
  51.         } else {
  52.             return NULL;
  53.         }
  54.     }
  55.      
  56. }
  57. $Habbo = new Habbo;
  58. $Habbo->GetHabboData("BadRequest!","com.br");
  59. print_r($Habbo);
  60. //para ler um atributo especifico $Habbo->[Nome do Atributo]
  61. ?>
Advertisement
Add Comment
Please, Sign In to add comment