PDA

View Full Version : HabboxForum API



Dentafrice
13-06-2008, 07:46 PM
I have created an API for HabboxForum to grab information about users.

To use it, replace Dentafrice in the following codes with the user's HxF username.



http://www.calebmingle.com/api/un/Dentafrice.xml


http://www.calebmingle.com/api/username/Dentafrice.xml


http://www.calebmingle.com/api/un/Dentafrice.xml


Any suggestions? Please post here.

--ss--
13-06-2008, 07:50 PM
:o, how'd you come across doing this? Didn't think it was possible O.o

Recursion
13-06-2008, 07:52 PM
Wan't to release the source? ;)

CoolHostUK-Dom
13-06-2008, 07:53 PM
:o, how'd you come across doing this? Didn't think it was possible O.o

Especialy from a remote server

Lee
13-06-2008, 07:56 PM
I think this is brilliant, +rep.

--ss--
13-06-2008, 08:02 PM
By anychance are you user an Curl spider to gather the content from the userprofiles then exploding the data into the xml tree?
Would it be possible to somehow view the user post-bits by getting around the search limit?

Dentafrice
13-06-2008, 08:03 PM
Why would you want to view the postbit? You're not going to be able to evade the search limit with an application like this. You need to rely on something that isn't blocked by timelimits.

Soon I will be caching this in a database, so load time will be faster.

Leetzgirl
13-06-2008, 08:07 PM
This XML file does not appear to have any style information associated with it. The document tree is shown below.


<userinfo>
<username>Dentafrice</username>
<joinDate>24-03-2008</joinDate>
<repPips>2</repPips>
<joinDateTimestamp>1882674000</joinDateTimestamp>
<referals>0</referals>
<totalPosts>1039</totalPosts>
<userTitle>Cautioned Member</userTitle>
<blogEntries>2</blogEntries>
<profileViews>103</profileViews>
<status>online</status>
<userid>48188</userid>
</userinfo>#

hfghfgh

Edited by SyrupyMonkey (Forum Super Moderator): Please do not spam in a thread, thanks.

jackass
13-06-2008, 08:07 PM
This is amazing.

I beg you to release the source via PM.

Me and Shane are in real need for this. :P

--ss--
13-06-2008, 08:07 PM
Why would you want to view the postbit? You're not going to be able to evade the search limit with an application like this. You need to rely on something that isn't blocked by timelimits.

Soon I will be caching this in a database, so load time will be faster.
To get the rep power :(

jackass
13-06-2008, 08:10 PM
RepPip??

I thought it was rep power, but it can't be. :P

Dentafrice
13-06-2008, 08:21 PM
#

hfghfgh

What?


This is amazing.

I beg you to release the source via PM.

Me and Shane are in real need for this. :P

You can use this API for your application, it should provide you with what you need, if it doesn't.. I can add it probably.


To get the rep power :(

I could probably make a way to determine how much rep you have from the number and type of pips.


RepPip??

I thought it was rep power, but it can't be. :P

Rep Pips are the little icons.

[Oli]
13-06-2008, 08:21 PM
RepPip??

I thought it was rep power, but it can't be. :P

It doesn't seem to count the rep power, but the rep blocks..
you know the green blocks.

Edit: damn forum lag.. (or my internet lag).. now dentafrice beat me to it lol ;)
anyway yeah what dentafrice said

Dentafrice
13-06-2008, 08:23 PM
As the rep power isn't displayed on the profile ;(

Jack!
13-06-2008, 08:31 PM
wow this is good ;)

Invent
13-06-2008, 08:34 PM
<?php

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, 'http://clubhabboforum.net/login.php?do=login');
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt ($curl, CURLOPT_POSTFIELDS, "Login data which is POSTed when you login. I'd have an example here, but it would include my account information, lol.");curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie');
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$store = curl_exec ($curl);

curl_setopt($curl, CURLOPT_URL, 'http://clubhabboforum.net/member.php?u=152');
$content = curl_exec ($curl);

curl_close ($curl);

?>
That's the sort of code you'd need to do it. The page is stored in the $content variable. (For the people who wanted a way of doing it). If you want/need to know how to get the information via a username not a user id then I'll explain it in a different thread.

--ss--
13-06-2008, 08:45 PM
It works :D
http://www.shanes.sawhosting.com/php/hxf.php?name=--ss--
(Replace --ss-- with someone else)
The next step is now turning it into GD.

Caleb, I think we're killing the server by running this script as the forum seems to be lagging quite alot O.o

Dentafrice
13-06-2008, 08:46 PM
I don't think it's us.

jackass
13-06-2008, 08:48 PM
This is great.

An aprox. rep ammount could be added through the ammount of blocks, obviously it won't be exact - but you know!

Agnostic Bear
13-06-2008, 08:57 PM
It's not the script, that's basically just a single request to the server, just like you and me browsing.

Dentafrice
13-06-2008, 08:59 PM
I'm caching it to the database now.

Invent
13-06-2008, 09:01 PM
OK. Here is the code to do like ?user=Invent on the php file.



<?php

$curl = curl_init( );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habboxforum.com/login.php?do=login' );
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'login post data' );
curl_setopt( $curl, CURLOPT_COOKIEJAR, 'cookie' );
curl_setopt( $curl, CURLOPT_COOKIEFILE, 'cookie' );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );

$store = curl_exec( $curl );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habboxforum.com/ajax.php?do=usersearch' );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'securitytoken=1213389717-511b74fba4f58d0a451b18e3c4cc913038c2bc77&do=usersearch&fragment='. $_GET[ "user"] );

$store = curl_exec( $curl );

$ex = explode( "<user userid=\"", $store );
$ex = explode( "\">", $ex[1] );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habboxforum.com/member.php?u='. $ex[0] );
$content = curl_exec( $curl );

curl_close( $curl );

echo $content;

?>
There's probably an easier/better way to do it, but I cba finding out if there is.

--

Also, Caleb, if you cache it won't that just mean the data is innacurate?

Agnostic Bear
13-06-2008, 09:03 PM
OK. Here is the code to do like ?user=Invent on the php file.



<?php

$curl = curl_init( );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habboxforum.com/login.php?do=login' );
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'login post data' );
curl_setopt( $curl, CURLOPT_COOKIEJAR, 'cookie' );
curl_setopt( $curl, CURLOPT_COOKIEFILE, 'cookie' );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );

$store = curl_exec( $curl );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habboxforum.com/ajax.php?do=usersearch' );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'securitytoken=1213389717-511b74fba4f58d0a451b18e3c4cc913038c2bc77&do=usersearch&fragment='. $_GET[ "user"] );

$store = curl_exec( $curl );

$ex = explode( "<user userid=\"", $store );
$ex = explode( "\">", $ex[1] );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habboxforum.com/member.php?u='. $ex[0] );
$content = curl_exec( $curl );

curl_close( $curl );

echo $content;

?>
There's probably an easier/better way to do it, but I cba finding out if there is.

--

Also, Caleb, if you cache it won't that just mean the data is innacurate?

Update the cache every so often.

[Oli]
13-06-2008, 09:04 PM
Also, Caleb, if you cache it won't that just mean the data is innacurate?

Could make it so it updates all records every day/12 or 24 hours ?
Oo & simon, if possible, come on msn pls ;)

Invent
13-06-2008, 09:05 PM
Yeah, I know it'll be updated but I thought the point of the API was to offer real-time information.

Also, I'm on MSN ;)

Dentafrice
13-06-2008, 09:11 PM
It is updated every five minutes. That saves the strain on mine and Habbox's server.

Dentafrice
13-06-2008, 09:34 PM
Its running at least 50% faster due to this. Any ideas?

Florx
13-06-2008, 09:43 PM
My signature script uses exactly the same type of code.

It also updates every 5 mins.

Agnostic Bear
13-06-2008, 09:44 PM
My signature script uses exactly the same type of code.

It also updates every 5 mins.

It doesn't handle spaces.

Florx
13-06-2008, 09:58 PM
Yet. :P

Sorry Caleb for crashing on your thread.

Independent
13-06-2008, 10:17 PM
Thanks, will come in handy.

DaveTaylor
13-06-2008, 10:20 PM
Doesnt work for my name ;)

Florx
13-06-2008, 10:21 PM
Because it has // in it :(

DaveTaylor
13-06-2008, 10:23 PM
Because it has // in it :(

there's a challenge for someone lol :P

loserWILL
13-06-2008, 10:37 PM
Do I make it an XML file or a PHP file?

Dentafrice
13-06-2008, 10:37 PM
what???

Independent
13-06-2008, 10:38 PM
Do I make it an XML file or a PHP file?If your reffering to Simon's code, by the looks of it yeah.

loserWILL
13-06-2008, 10:40 PM
So here is my XML file code:


<?xml version="1.0" encoding="utf-8"?>
<?php

$curl = curl_init( );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habbos.net/login.php?do=login' );
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'login post data' );
curl_setopt( $curl, CURLOPT_COOKIEJAR, 'cookie' );
curl_setopt( $curl, CURLOPT_COOKIEFILE, 'cookie' );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );

$store = curl_exec( $curl );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habbos.net/ajax.php?do=usersearch' );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'securitytoken=1213389717-511b74fba4f58d0a451b18e3c4cc913038c2bc77&do=usersearch&fragment='. $_GET[ "user"] );

$store = curl_exec( $curl );

$ex = explode( "<user userid=\"", $store );
$ex = explode( "\">", $ex[1] );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habbos.net/member.php?u='. $ex[0] );
$content = curl_exec( $curl );

curl_close( $curl );

echo $content;

?>

And then I get the following error:
XML Parsing Error: no element found
Location: http://kolzy.com/hapi/habbos.xml?user=Chlorofluorocarbon
Line Number 30, Column 4:?>
---^

Invent
14-06-2008, 12:48 AM
So here is my XML file code:


<?xml version="1.0" encoding="utf-8"?>
<?php

$curl = curl_init( );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habbos.net/login.php?do=login' );
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'login post data' );
curl_setopt( $curl, CURLOPT_COOKIEJAR, 'cookie' );
curl_setopt( $curl, CURLOPT_COOKIEFILE, 'cookie' );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );

$store = curl_exec( $curl );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habbos.net/ajax.php?do=usersearch' );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'securitytoken=1213389717-511b74fba4f58d0a451b18e3c4cc913038c2bc77&do=usersearch&fragment='. $_GET[ "user"] );

$store = curl_exec( $curl );

$ex = explode( "<user userid=\"", $store );
$ex = explode( "\">", $ex[1] );

curl_setopt( $curl, CURLOPT_URL, 'http://www.habbos.net/member.php?u='. $ex[0] );
$content = curl_exec( $curl );

curl_close( $curl );

echo $content;

?> And then I get the following error:
XML Parsing Error: no element found
Location: http://kolzy.com/hapi/habbos.xml?user=Chlorofluorocarbon
Line Number 30, Column 4:?>
---^

I've bolded a part of your code which I hope will help you fix the problem.

Dentafrice
14-06-2008, 01:23 AM
echo '<?xml version="1.0" encoding="utf-8"?>';


It isn't returning any XML, it is returning an assload of HTML.

Florx
14-06-2008, 01:25 AM
Make sure it is a PHP file because if I view source on your .xml page I can see your php :P.

Dentafrice
14-06-2008, 01:35 AM
Its PHP ;) I have now added profile information.

Habbo Name, etc.

Hypertext
14-06-2008, 01:38 AM
Nice.

This is NOT a flame-post, but this isn't an api as you can't make any requests to it, habbox would have to make they're own api, although:

This IS a VERY useful tool and well done for making it.

Dentafrice
14-06-2008, 01:44 AM
Thanks ;)

It is an API, you can make requests.. you get information. A GET request is still a request, a POST request is still a request.. either getting information or sending information is still making a request ;)

So don't get smart with me.


Just added 'Last Activity'.

Hypertext
14-06-2008, 01:50 AM
Is it cached or does it on it's own, if it does it on it's own thats going to be some strain on your server, if it gets real laggy I suggest optimizing it and running it through putty, it'll run faster, also if it runs real low you might want to do some ini_set()'s resource-wise.

Dentafrice
14-06-2008, 02:00 AM
Charlie, i'm not stupid.. you are making yourself look stupid.

Run it through PuTTY? PuTTY is for connecting to SSH, not anything to do with PHP or optimizing.

ini_set? Why the heck would I need to do that, all it is, is a a cURL to the server, takes less resources then a normal viewer like us to do it.

It is cached on a MySQL database ;)

I just added 'Recent Visitors' to it.

Hypertext
14-06-2008, 02:06 AM
i'm just saying that if you end up wanting to cache it all, you could do it a lot quicker by using forks, which can ONLY run from a command line. Putty isn't just for connecting to SSH it can do alot more.

Dentafrice
14-06-2008, 02:08 AM
Ha, I think I should know what PuTTY is.

All PuTTY is, is a SHH/Telnet client.. it isn't anything to do with the server.. it doesn't even run on the server.

What the heck is forks? If it can only be run VIA command line, that means someone is going to have to do it by hand, or, have shell access, or let PHP have shell access.

It is all cached, everything that goes through it is cached..


You're wrong.

Hypertext
14-06-2008, 02:17 AM
php.net/pcntl_fork


OMG CALEB DOESN'T KNOW SOMETHING!

Seriously, get over yourself, it is something to do with the server.

The only thing needed to be done by hand is type 'php fileToRun.php > output.log'. I'm done you'll never admit anything, you'll just think your the best at everything and live in your moms basement "Rearranging the office" on twitter, no offence, but klydo.com failed and you promised it wouldn't. I'm getting personal because its hilarious how up your ___ you are.

I'm done.

Dentafrice
14-06-2008, 02:25 AM
#1: pcntl has nothing to do with caching, it is more to do with threading and processes. Forks is a MAC application.

#2, every PHP function has something to do with the server.

#3, Why would I output into a log? I'm caching something for faster load time, not making a ******* log..

#4, You're not getting personal, you're making a fool out of yourself. You are the new Darren Toogood, no-one likes you..

You're just trying to 'insult' me, if that is what you call it, but its pathetic. It might be 'hilarious' to you, but I don't see anyone else laughing.

You really don't know what you are talking about, not at all. I don't even think you understand how this even really works, and you are 'trying', to make yourself look smart.. it isn't working.

You're talking about 'run it through putty', and 'run it through forks', but you don't even know what the **** these are.. you can't run anything through putty, or anything through pcntl.

You just think 'Hey! I will attempt to say something smart... because everyone else is dummer then me! I know more then Caleb!' but you really don't, and you are only making yourself look stupid.

You can't even use pcntl_fork when it is used as an Apache module, it has to be run via the CLI or CGI mode.

Why would I type that in by hand? The purpose of caching something is to reduce load time.. not making a ******* backup.

You come on here telling me 'Not to flame, but this isn't an API', where you couldn't tell a ******* API from your..

To end this nice and short.. you have just been owned. Have a nice day.

http://i151.photobucket.com/albums/s133/ajreynol/1183516964973fx91.jpg

Note to moderator, this isn't trolling nor a negative attitude, read his posts.

loserWILL
14-06-2008, 02:38 AM
I'm confused, so can someone tell me how I would go about setting up the AIP (i.e. a PHP file, etc.) +rep

Dentafrice
14-06-2008, 02:39 AM
You don't set this up.. this is a 'Data Feed'/API used in applications.

I have noticed lots of status signatures and HxF information things popping up lately, so I made this for it.

http://www.calebmingle.com/api/un/loserWILL.xml

loserWILL
14-06-2008, 02:41 AM
No I mean, I want to use one of the codes supplied and set up my own. How would I go about adding one of the supplied codes to a file?

Dentafrice
14-06-2008, 02:43 AM
I'm not releasing the source.. Invent posted a little information on how to do it, you have to do all the data handling yourself..

loserWILL
14-06-2008, 02:46 AM
I didn't say to release the source - I just want a little help on how I would get one of these running on my own server.

Dentafrice
14-06-2008, 02:47 AM
So you're trying to set up a data feed, or just trying to get information?

loserWILL
14-06-2008, 02:49 AM
I'm just trying to get the information of a user.

Dentafrice
14-06-2008, 01:53 PM
I'm just trying to get the information of a user.
http://www.calebmingle.com/api/un/USERNAMEHERE.xml

Want to hide these adverts? Register an account for free!