public static function getAlexaRank($domain)
    {
        $domain = preg_replace('~^https?://~', '', $domain);
        $alexa = 'http://data.alexa.com/data?cli=10&dat=s&url=%s';
        $request_url = sprintf($alexa, urlencode($domain));
        $xml = simplexml_load_file($request_url);

        if (!isset($xml->SD[1])) {
            return false;
        }

        $nodeAttributes = $xml->SD[1]->POPULARITY->attributes();
        $text = (int) $nodeAttributes['TEXT'];

        return $text;
    }