I had a few requests in the last few months to create another WebBuild updater since habbo managed to stop the old functions by adding a cookie to their pages.
Here is a new way of doing it.
Add these functions to your CMS.
Now you can just use
That will output something like: 63_1dc60c6d6ea6e089c6893ab4e0541ee0/1273
If you add the functions to a class, lets say the core class from user, then you would use it like
Pretty simple but I figured I'd share as usual.
Here is a new way of doing it.
Add these functions to your CMS.
PHP:
<?php
function get_content($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)');
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); //saved cookies
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$string = curl_exec ($ch);
curl_close ($ch);
return $string;
}
function get_between($input, $start, $end)
{
$substr = substr($input, strlen($start)+strpos($input, $start), (strlen($input) - strpos($input, $end))*(-1));
return $substr;
}
function GetWebBuild($site)
{
$content = get_content('http://habbo.'.$site);
$webbuild = get_between($content, "http://images.habbo.com/habboweb/", "/web-gallery");
echo $webbuild;
}
?>
Now you can just use
PHP:
GetWebBuild('com');
That will output something like: 63_1dc60c6d6ea6e089c6893ab4e0541ee0/1273
If you add the functions to a class, lets say the core class from user, then you would use it like
PHP:
$core->GetWebBuild('com');
Pretty simple but I figured I'd share as usual.