View Full Version : Retrieving Habbo Users Mission using PHP
Hey,
Was wondering if you could help me.
Is there a way, and I know three must be, of retrieving a Habbo's Mission/Motto and displaying it using PHP?
Ty :)
Callum.
Ive tried so many things and it just wont work!
BUMP! Need this urgently :L
BoyBetterKnow
11-10-2009, 03:57 PM
I guess it'd be going to the habbos homepage and searching the code for the div or w/e and then use it ?
Hmm... I'll give it a try
LMS16
11-10-2009, 04:20 PM
I guess it'd be going to the habbos homepage and searching the code for the div or w/e and then use it ?
That wouldnt work as php is server side, surely u knew that?
And erm... there should be a link of some sort to select it from the db or sumit...
All I could reccommend is looking at a status gen and looking for the motto
I found this:
function motto()
{
$motto = explode('<div class="profile-motto">', $this->data);
$motto = explode('</div>', $motto[1]);
$motto = trim($motto[0]);
$motto = str_replace(' <div class="clear">', '', $motto);
return $motto;
}
Lew.
I saw that but its changed since that one was produced :P
Ty anyway
LMS16
11-10-2009, 04:43 PM
check the name of the div then and change it...??
Lew.
BoyBetterKnow
11-10-2009, 05:04 PM
That wouldnt work as php is server side, surely u knew that?
I said "I guess it'd be going to the habbos homepage and searching the code for the div or w/e and then use it ?"
Using a function of his choice he could request the page. And my dearest Lewiie, surely you knew that the habbo pages are displayed in client side code.
www.habbo.co.uk/home/Callie
Then do explode or w/e to extract the mission.
Don't know where you got php being server side from me saying to go to a habbos homepage and searching the code for the div.
A div is in html code, not php. Surely you knew that?
LMS16
11-10-2009, 06:52 PM
My bad, i thought you mean fetch the php code from within the div... lol
Lew.
if (habbo.IsLoggedIn)
{
String myMotto = habbo.Motto;
habbo.Motto = ("New motto"); // Sets motto to 'New motto'
}
else
{
return; // If the user isnt logged in, then return
}
This might help, no idea
stop putting lew after each post its pretty annoying
Blinger1
14-10-2009, 08:23 PM
very sloppy coding here:
<?php
$user = $_GET['user'];
$page = file_get_contents("http://www.habbo.co.uk/home/$user"); // Change the URL to the hotel you would like
$start = explode('<div class="profile-motto">', $page, 2);
$end = explode('<div class="clear"></div></div>', $start[1], 2);
$motto = trim($end[0]);
echo ("$motto"); // Set the message you want to be displayed (Leave in the $amount)
?>
then go to http://yoursite.com/motto.php?user=Blinger (that would retrieve my motto)
Thanks for your help. i did try something like that but It didnt work. I'll look at your code now :) Thank you :P
Blinger1
14-10-2009, 08:46 PM
it works (well it did for me anyway)
OKay thanks :) Could you give me an indication as to what the comment :
//leave in the $amount thing is all about?
Blinger1
14-10-2009, 09:28 PM
yeah ignore that, i just edited the code from the display habbos online... change it to "//leave in the $motto" if you really want that part..
If you want an advanced one whereby you could get that certain habbo's username, mission and figures even if their homepage's locked or banned, you've to use curl or something that could send a POST request to another page.
URL: http://www.habbo.com.sg/myhabbo/avatarlist/avatarinfo
Field to send: ownerAccountId={the habbo id}&anAccountId=
else, just use what Blinger did.
Blinger1
15-10-2009, 08:29 AM
i don't get what you mean, elaborate a bit more please...
Okay basically http://www.habbo.com.sg/myhabbo/avatarlist/avatarinfo is a POST page. When you visit your own homepage, it'll send a POST request to that page and then display your profile widget (The one with your Habbo name, habbo figures etc).
Protege
15-10-2009, 09:18 AM
define what you have to post then and the post fields?
Blinger1
15-10-2009, 09:20 AM
define what you have to post then and the post fields?
... that made no sense.
I found all these on:
http://foro.habbos.es/index.php?topic=17554.0;wap2
http://subculturahabbo.com/HZFORO/foro/index.php?topic=1493.0
Protege
15-10-2009, 09:30 AM
POST page
That means DATA has to be POSTED (If you don't know what that means... oh my days, go move further to New Zealand), in order to POST data you need to know the data that needs to be posted (post field), for example it could be "Username" or it could be "UserID" or it could be "Email" (if you didn't realise, it could be "YoureStupid" and the value could equal True. Or anything by that matter.), if he found that there's a page that needs data to be POSTED to he will most likely know the fields.
Do you understand that?
@Scold, lovely its in Spanish lool, I can see what I can pick out though.
Edit: I couldn't re in act what he was trying to do with a simple form, so I have no idea if it still works any more. When I checked habbo UK, there was no POST pages except for the one requesting buddies etc (didnt really look into it).
Yea like what Protege said, I failed in explaining. I'd provided the fields @ my previous post so if you want to try doing it, feel free.
@Protege, google translator does the job well. :D
Blinger1
15-10-2009, 09:44 AM
POST page
*snip*
I know what a post page is.. but what you wrote didn't make sense, shall i make it bold?
define what you have to post then and the post fields?
Protege
15-10-2009, 09:45 AM
Makes sense to me soz, might be cause im just great.
& Lol@Me for being blind and not seeing.
LOl. i know how it works. it was just the comment blinger had left in :P God. :/
Dromenail
15-10-2009, 03:05 PM
i remember somebody released a habboClass thing which could get all this info. ill try and dig it out for you.
edit:
<?php
class habboClass
{
var $data;
var $habboname;
var $hotel;
var $online;
var $private;
var $banned;
var $actual;
var $motto;
var $badge;
var $figure;
var $birthdate;
var $normal;
var $name;
function habboClass($habboname, $hotel)
{
$this->habboname = $habboname;
$this->hotel = $hotel;
$this->data = file_get_contents("http://habbo." . $hotel . "/home/" . $habboname);
if (eregi("This page is not available anymore", $this->data)){
$this->banned = true;
}else{
$this->banned = false;
}
if (eregi("habbo_online_anim.gif", $this->data)){
$this->online = true;
}else{
$this->online = false;
}
if (eregi('<div id="page-headline-text">Habbo Homes</div>', $this->data)){
$this->actual = true;
}else{
$this->actual = false;
}
if (eregi('marked this page as private.', $this->data)){
$this->private = true;
}else{
$this->private = false;
}
$motto = explode('<div class="profile-motto">', $this->data);
$motto = explode('</div>', $motto[1]);
$motto = trim($motto[0]);
$this->motto = str_replace(' <div class="clear">', '', $motto);
if (eregi("c_images/album1584/", $this->data)){
$badge = explode('http://images.habbohotel.' . $this->hotel .
'/c_images/album1584/', $this->data);
$badge = explode('.gif', $badge[1]);
$badge = trim($badge[0]);
$this->badge = "http://images.habbohotel." . $this->hotel . "/c_images/album1584/" . $badge .
".gif";
}else{
$this->badge = false;
}
$this->figure = "http://campaigns.habbo.com/0702/app/habboimage.php?habboname=".$this->habboname."&site=http://www.habbo.".$this->hotel;
$birthdate = explode('<div class="birthday date">', $this->data);
$birthdate = explode('</div>', $birthdate[1]);
$this->birthdate = trim($birthdate[0]);
if (!$this->banned and !$this->private and $this->actual){
$this->normal = true;
}else{
$this->normal = false;
}
$name = explode('<span class="name-text">', $this->data);
$name = explode('</span>', $name[1]);
$name = trim($name[0]);
$this->name = $name;
}
}
use like
$habbo = new habboClass();
$habbo->habboClass($_GET['habboname'],$_GET['hotel');
echo $habbo->habboname;
or w/e
it uses some depricated functions but it should be okay.
Luggruff
23-03-2013, 05:36 PM
Anyone know how to do this today with the page http://www.habbo.nl/habblet/habbosearchcontent?searchString=Lugrguff ?
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.