Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2007
    Location
    UK
    Posts
    56
    Tokens
    0

    Default [PHP] Number of habbos online [PHP]

    Ok so theres a new habbo layout, which means the codes changed right?

    so can anyone tell me the current code for displaying the number of habbos online, and tell me where i can host it e.g. **********, etc etc

    Ty in advance

  2. #2
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    Its still the same code :S??

    PHP Code:
    <?php
    $hotel 
    file_get_contents("http://www.habbo.co.uk/");
        
    $start explode('<span class="stats-fig">'$hotel2);
    $end explode('</span>'$start[1], 2);
    $habbo trim($end[0]);

    echo(
    "Habbos online: $habbo");
    ?>

  3. #3
    Join Date
    Feb 2007
    Location
    UK
    Posts
    56
    Tokens
    0

    Default

    Quote Originally Posted by Blinger View Post
    Its still the same code :S??

    PHP Code:
    <?php
    $hotel 
    file_get_contents("http://www.habbo.co.uk/");
        
    $start explode('<span class="stats-fig">'$hotel2);
    $end explode('</span>'$start[1], 2);
    $habbo trim($end[0]);

    echo(
    "Habbos online: $habbo");
    ?>
    I cant use this one as 11ombDotCom doesnt support it ;[

  4. #4
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    change host then.. There are plenty of hosts which support PHP

  5. #5
    Join Date
    Mar 2008
    Posts
    940
    Tokens
    75

    Default

    PHP Code:
      <?php

    if ($_GET['highlight'] === 'true')
    {
      
    highlight_file(__FILE__);
    }

    else
    {
      
    $html file_get_contents('habbo.html');
      
    $time microtime(true);

      
    preg_match('#<span class="stats-fig">(\d+)</span>#'$html$matches);

      echo 
    microtime(true) - $time;
    }


  6. #6
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Turbocom View Post
    PHP Code:
      <?php

    if ($_GET['highlight'] === 'true')
    {
      
    highlight_file(__FILE__);
    }

    else
    {
      
    $html file_get_contents('habbo.html');
      
    $time microtime(true);

      
    preg_match('#<span class="stats-fig">(\d+)</span>#'$html$matches);

      echo 
    microtime(true) - $time;
    }
    we have already solved it though? He just needs a decent host.

  7. #7
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Turbocom View Post
    PHP Code:
      <?php

    if ($_GET['highlight'] === 'true')
    {
      
    highlight_file(__FILE__);
    }

    else
    {
      
    $html file_get_contents('habbo.html');
      
    $time microtime(true);

      
    preg_match('#<span class="stats-fig">(\d+)</span>#'$html$matches);

      echo 
    microtime(true) - $time;
    }
    That's an incorrect code. That has benchmarking code in it, and a file highlighter.. it doesn't display the users online at all.. nor does it even check the real Habbo, but a saved version of the homepage.

  8. #8

    Default

    Yeah, that code was designed to eliminate the number of factors when benchmarking by using a static file versus the habbo server request which the response time could vary depending on the server load (sure you'll get read variations with a static file but it would be less).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •