SEO Rankings URL file-access


(ha100) #1

if plugin returns error message : URL file-access is disabled in the server configuration

in RankChecker.php around line 53
change function getAlexaRank() to this

public function getAlexaRank()
        {
                $url = $this->url;
                $url = 'http://data.alexa.com/data?cli=10&url=' . $url;
                $curl = curl_init();
                curl_setopt($curl, CURLOPT_URL, $url);
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($curl, CURLOPT_REFERER, 'http://YOUR_DOMAIN/');
                $xml = simplexml_load_string(curl_exec($curl));
                curl_close($curl);
                return $xml->SD->POPULARITY['TEXT'];
        }

i am also interested what would be the proper way of using YOUR_DOMAIN as a piwik variable. thx


(vipsoft) #2

Thanks. We’ll change this to use Piwik_Http.


(vipsoft) #3

This should be a one-line fix, e.g.,

From:

$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&url=' . $url);

To:

$xml = simplexml_load_string($this->getPage('http://data.alexa.com/data?cli=10&url=' . $url));

(mopeppers) #4

[quote=vipsoft @ Jul 22 2010, 03:05 AM]This should be a one-line fix, e.g.,

From:

$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&url=' . $url);

To:

$xml = simplexml_load_string($this->getPage('http://data.alexa.com/data?cli=10&url=' . $url));

[/quote]
Hi,
I have tried the above, but without result.
My error message looks like

Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 5: parser error : Opening and ending tag mismatch: META line 2 and HEAD in xxx/piwik/plugins/SEO/RankChecker.php on line 61

Backtrace -->
#0 Piwik_ErrorHandler(2, simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 5: parser error : Opening and ending tag mismatch: META line 2 and HEAD, xxx/piwik/plugins/SEO/RankChecker.php, 61, Array ([url] => http://data.alexa.com/data?cli=10&url=www.mopeppers.at/de,[curl] => Resource id #120))
#1 simplexml_load_string(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://data.alexa.com/data?">http://data.alexa.com/data?</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Access Denied.
</STRONG>
<P>
Access control configuration prevents your request from
being allowed at this time. Please contact your service provider if
you feel this is incorrect.
</UL>
<P>Your cache administrator is <A HREF="mailto:root">root</A>.

Any suggests ?
Thanks,
Anton


(vipsoft) #5

I don’t know where the response is coming from (alexa, or from your network), but as a workaround, in plugins/SEO/RankChecker.php, add the ‘@’ to the call to simplexml_load_string, i.e., changing:

        $xml = simplexml_load_string(...);

to:

        $xml = @simplexml_load_string(...);

#6

Thanks For share…

link recomendate :
Channelbola.com Agen Bola Resmi Piala Eropa 2012
Home Page site
988BET Agen Bola Untuk Prediksi Piala Eropa 2012