Alexa Ranking Script

Status
Not open for further replies.
Has anyone installed it successfully on Wordpress?

I followed the exact instructions found above...but getting error :(

Thanks
 
ok let's see now

xxx has a traffic rank of: 949,896
country 22,034

let's see this in a few days :)
 
If you're getting an error or a blank index page in wordpress, try adding } after the line that has $keylength = 14; Here's an example of a wp blog with this working:

<?php
/* Short and sweet */
session_start();
function alexa($url)
{
$url="http://celebphotos.biz".$url;
$domain = "http://data.alexa.com";
$keylength = 14;
}
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
?>
 
If you're getting an error or a blank index page in wordpress, try adding } after the line that has $keylength = 14; Here's an example of a wp blog with this working:

<?php
/* Short and sweet */
session_start();
function alexa($url)
{
$url="http://celebphotos.biz".$url;
$domain = "http://data.alexa.com";
$keylength = 14;
}
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
?>

brwipens DOWNLOAD the whole file I've attached!Not only the text I've post it here just as demo to show wp integration ..

Vrindavan you need to have PHP support on your hosting
 
its climbing lol

My country is now 21,144
previously 22,034
 
>> Vrindavan you need to have PHP support on your hosting


must use php page ? no htm pages ?
 
Hi all... I'm eric, CyberNac's cousin. I'm down in Bogota Colombia for the week bustin' ass on another biz so haven't hardly had time for my own cousin much less this forum. My eyes are bugging out from doing QuickBooks all friggin' day, so I'd thought I'd take a little break and put out some comments.

First, I'm really taken aback that my crappy little PHP hack has garnered some interest. Major props to MoneyMafia for extending the code and supporting the community. :cool:

Second, I wanted to point out a few things regarding the script. As MoneyMafia said, it's barely been tested so anybody trying this is a guina pig. FWIW, the site we deployed it on has seen an increase of signifigant size while her organic traffic hasn't increased much, if at all. Thus, its reasonable to suggest that there *might* be something here. However, Alexa doesn't appear to update their stats servers (by my math there are about 8-10 different nodes) all that often... perhaps weekly. So, it could take time for the ballot stuffing to take effect.

Third, the script kinda assumes that you have traffic to begin with. IMHO, the reason WHY Alexa, Compete and the whole lot of them that rely on client submission of data SUCK EGGS that it's pretty easy to duplicate... thus the ballot stuffing.

Assume for a minute that the alexa client is installed on 5 in 100 computers. To estimate your traffic, alexa assumes that your real traffic must be 20 times whatever value they got. Anybody who stayed awake even one day in statistics would realize how stupid this is. (A website dedicated to PHD-Level supercomuting discussions probably *isn't* frequented by people silly enough to install a piece of crap toolbar like Alexa.)

The way this script works is by duplicating the trigger that Alexa uses for EVERY visitor... not just those with the toolbar installed. So, using the example above, (and assuming the code actually works) you'd be inflating your traffic rate by a factor of 20.

Heres the kicker though: If you don't have traffic to begin with, this script is essentially worthless. It's important to understand that the trigger activates when a client "loads" an image that has this code as it's source. This is what causes the source IP to be the client rather than the server, or your own desktop. But if nobody is visiting your site to begin with, then the trigger won't happen, get it?

Anyway, I just thought i'd throw that out. Sorry i haven't been around to help out. If it helps make up for it, heres my experiment with Compete.com: :p

PHP:
<?php

  // This information was gleened from the windows registry and is used in the UserAgent string
  $CfgVer   = "1809";  //
  $DCAVer   = "1809";  //
  $UserID   = rand(500000,2500000); // Hopeing it's okay to make this random...
  $RulesVer = "0008";  //
  
  ini_set('user_agent', 'mayflower/'.$CfgVer.'/'.$DCAVer.'/'.$UserID.'/'.$RulesVer);  // This is the useragent used by the compete.com toolbar
  
  // set some more variables
  $domain = "http://66.151.182.194/fast-cgi/ClickServer";  // The URL that receives the ClickData
  $ts     =  time();                                       // Local Timestamp based on seconds from epoch
  $bua    = "N/A";                                         // No clue
  $meth   = "get";                                         // No clue
  $eid    = "300";                                         // No clue
  $fid    = "NULL";                                        // No clue
  $bin    = "5178486";                                     // No clue
  $url    = "http://www.yourwebsitehere.com/";              // The site being clicked on
  $md5    = "00000000000000000000000000000000";            // A MD5 hash of the above information (the specifics on how the secret is constructed is unknown.
                                                           // We stuff the variable with junk initially.  This will be used to get correct value later.
  
  // $data is the payload for the HTTP POST method
  $data = "md5=".$md5."&ts=".$ts."&bua=".$bua."&meth=".$meth."&eid=".$eid."&fid=".$fid."&bin=".$bin."&url=".$url;

  // We submit a first (and probably invalid) request to obtain short XML-like markup reply.  within this reply is the real MD5 hash.
  // we then extract that hash for use later. 
  $result = request($domain, $data);
  $hash = substr($result,strpos($result,"<md5>")+5,32);
  
  // So, we take the hash and generate a new payload with the correct MD5 hash
  $md5 = $hash;
  $data = "md5=".$md5."&ts=".$ts."&bua=".$bua."&meth=".$meth."&eid=".$eid."&fid=".$fid."&bin=".$bin."&url=".$url; 

  // Resend the request, this time with the correct hash value.  
  echo request($domain, $data);
  
  // This function sends the HTTP POST data.
  function request($url, $data)
  {
     $fp = @fopen($url, 'rb', false, stream_context_create(array('http'=>array('method'=>'POST','content'=>$data))));
     $response = @stream_get_contents($fp);

     return $response;
  }
    
?>

Now, before anybody gets all crazy here, the above does NOT work like the alexa code. I'll elaborate:

This was was a little bit tougher. See, the folks at compete actually make an attempt to filter out ballot stuffing... Fortunately, their attempt is totally half assed. What they do is include in the POST DATA a MD5 hash of the information being reported back ***and*** some secret code which I couldn't figure out.

But thats really okay, because if you send them a invalid POST, they respond anyway, and part of the response includes the *correct* MD5 hash. So, you just take that value and activate the trigger again. Stupid, huh? Hopefully they weren't intending to use MD5 as a security method.

The only other important thing is that they use a custom user agent string that must be duplicated otherwise their server rejects it. And this is what makes it worth not too much more that an experiment. You see, there is no way to change the user agent string on a client... at least not that i am aware of. (My first thought was JavaScript, but the window.agent string is read-only, so... no joy.)

Anyway, consider the above an experiment for those inclined to explore.

If anybody can figure out a way to do the following, i'd be excited to hear about it:

- TASK A -
Figure out how submit a HTTP POST request from a client merely by having the client load the page. (I do not think this is possible)

- TASK B -
Figure out how to change the useragent on the client for one transaction only. Only client side scripting is allowed. (I do not think this is possible either)

Saludos,

Eric
 
Task A Iframes :D
Put this in your HTML page
PHP:
<form name="hiddenform" method="post" target="iframe1">
	<input type="hidden" name="a" value="add_vote"> 
	<input type="hidden" name="action2" value="save"> 
	<input type="hidden" name="email" value="">

PHP:
 <iframe width="0" height="0" frameborder="0" hspace="0" vspace="0" marginheight="0" marginwidth="0" name="iframe1" scrolling="no"></iframe>

and you actuall send the form using Java Script:

PHP:
sites[0] = new Array(2);
	sites[0][0] = "Sitename";
	sites[0][1] = "http://www.sitename.com";
document.hiddenform.action = sites[s][1];
document.hiddenform.submit();

I've copied this fast from a script.. Change it to fits your needs
 
Hey! :eek: I see what you did there.... :cool:

Props. But, in order to get it to source from the client you still need to post with a different user agent. Any thoughts on that one? Wanna go 2 for 2?
 
Does it work? Still not enough track record to be sure... Just checked though and the test site jumpped up another 70k spots in the past week! I don't think that's an accident...

:D
 
anybody can help me. how can I setup this script?

save txt file to php file and upload to root domain?
 
hatisenang, I follow MoneyMafia guide above
and it seems work on my wordpress blog, no error found
I don't have a big traffic blog so I can't say it works or not
I need to implement it on my builder script but still can't do it.

Another problem with alexa,
I use ff search status plugins
and it shows different ranking compared with the alexa rank on their web.
 
Any idea of how to get this to work with a Joomla website? I have a Joomla site that I put it into the index.php code and it just displays the code on the top of the page.
 
Status
Not open for further replies.
Back
Top