• Home
  • About
  • Piqq.us Invite Feed
  • Links
  • RSS CULT
  • A Lovely Anchor Text/Domain Shuffler Script

    Add to Mixx!

    Alright. So I decided I’d pump out a script for you guys today.

    Here’s the premise: You’re doing a link exchange. Or writing a wordpress plugin that will give credit back to you via link love. Or making a free wordpress template. Or a myspace layout. Or really anything. No matter what, if you’re getting mass deployed, you might want to consider having alternating link text. Essentially, the entire fix Google did to fix Google Bombs was to simply make it so any anchor text that appeared suddenly and was repeated identically, would lead to a sandbox for that keyterm. So in any mass deployment it’s best to be careful.
    Beyond that, who wants to target only one section of a niche? PSHA!

    This script is pretty basic, but pretty lovely.

    Disclaimer: Wordpress has slaughtered my code in the past, so I’m going to link to the script at the bottom of the entry. I’ll try and paste the code here though.

    How It Works:
    Computers cannot create truly random numbers. So as a result, we have to give them a starting point. A “seed” number. Let’s say our seed is 4, and we generate 10 numbers. If we terminate the program, and run it again with the same seed, we will get…that’s right. The exact same numbers. So this converts the domain the script is being accessed from into a seed number. The anchor text will never change on that domain. But as soon as it’s deployed on another domain, so will the links. Sound good? I thought so.

    Getting our Seed Number
    function getSeed()
    {
    $script=$_SERVER['HTTP_HOST'];//the current domain/subdomain being accessed
    $amt=0;
    $script=strtolower($script);//capital letters in the domain could interfere with which link is shown w/ older webservers
    for($i=0; $i < strlen($script); $i++)
    {
    $amt+=ord($script{$i});//convert letter to numerical value, and add
    }
    return($amt);
    }

    Loading Our Links

    function getLinks()
    {
    $links=array();
    //first, we load the first key of the second dimensiondimension of our array with the urls we want to promote
    $links[0][0]="http://www.slightlyshadyseo.com";
    $links[1][0]="http://www.slightlyshadyseo.com/?p=157";
    //next, we pick our anchor text for these, and load it into the second tier.
    //these will show up as anchor text whenever slightlyshadyseo.com is the link
    $links[0][1]="Slightly Shady SEO";
    $links[0][2]="SEO Blog";
    $links[0][3]="Shady SEO Blog";
    $links[0][4]="Blackhat Marketing";
    $links[0][5]="Blackhat SEO blog";
    //these will show up whenever the specific article is linked to.
    $links[1][1]="Wordze Review";
    $links[1][2]="Keyword Selector";
    $links[1][3]="Keyword Tool";
    return($links);
    }

    Our Main Code

    $seed=getSeed();
    srand($seed);//initialize the random number generator with our seed
    $links=getLinks();//retrieve our array of links
    $siteIndex=rand(0,sizeof($links)-1);//only examines the number in the first [#] of links[][]
    $anchorText=rand(1,sizeof($links[$siteIndex])-1);//this examines the number of anchors available at location $siteindex
    echo "<a href=\"".$links[$siteIndex][0]."\">".$links[$siteIndex][$anchorText]."</a>";

    Not to difficult, eh? Just replace my links/anchor text with yours, and add as many as you’d like.

    Source Code To this Project

    Any bug fixes(I can’t image how there would be) feel free to comment below.
    As always, if you enjoy/use the script, I’d appreciate some link-lovin.

    -XMCP

    PS: This is not the magical script I’ve been working on for you guys. That one started as Javascript, turned into Javascript and PHP mixed, and from there became a Wordpress Plug-in. Base functionality is done, despite my hatred for JS. Now all I have to do is learn how to make a plugin….

    Share and Enjoy(You know you want to): These icons link to social bookmarking sites where readers can share and discover new web pages.
    • Technorati
    • StumbleUpon
    • Reddit
    • PlugIM
    • Blue Dot
    • Bumpzee
    • Simpy
    • Netscape
    • del.icio.us
    • blogmarks
    • Spurl
    • Furl
    • Fark
    • TailRank
    • BlinkList
    • NewsVine

    14 Responses to “A Lovely Anchor Text/Domain Shuffler Script”

    1. xlspecial says:

      Nice stuff XMCP. Quick question; Is it possible to add more base links and anchor text to go with them? Here’s a snip that will better explain what I am talking about;


      $links=array();
      //first, we load the first key of the second dimensiondimension of our array with the urls we want to promote
      $links[0][0]="http://www.acxn.net";
      $links[1][0]="http://www.acxn.net";
      $links[2][0]="http://www.racersengineering.com";

      //next, we pick our anchor text for these, and load it into the second tier.
      //these will show up as anchor text whenever slightlyshadyseo.com is the link
      $links[0][1]="Slightly Shady SEO";
      $links[0][2]="SEO Blog";
      $links[0][3]="Shady SEO Blog";
      $links[0][4]="Blackhat Marketing";
      $links[0][5]="Blackhat SEO blog";

      //these will show up whenever the specific article is linked to.(in this case, a wordze review)
      $links[1][1]="Wordze Review";
      $links[1][2]="Keyword Selector";
      $links[1][3]="Keyword Tool";

      //these will show up whenever the specific article is linked to.(in this case, a wordze review)
      $links[2][1]="Wordze Review";
      $links[2][2]="Keyword Selector";
      $links[2][3]="Keyword Tool";

      return($links);

      Obviuiosly I haven’t changed much yet, but I think you see what I’m talking about.

      Thanks for this script XMCP. Nice of you to share it.

    2. 5ubliminal says:

      Why does this post sound so much like my TextBlender v/1.0 :) Gotcha!

    3. W-Shadow says:

      An interesting script, if a bit simplistic.

      By the way, try the WP-Syntax plugin for auto-formatting code in your posts; it works very well on my blog.

    4. Jerome says:

      Nice, I like it.

      Unrelated, I have to say it’s so frustrating paging through all my feeds in feeddemon and coming across your feed as a partial. How about pushing the feed to full posts?

    5. admin says:

      @5ubliminal: Because I’ve already SHOWN code here that worked exactly like yours, and you’ve already commented on it? And you only released yours after I released mine? Much respect buddy, but get your memory checked a bit ;)

      @W-Shadow: I’ll give it a go. What I’m using right now just so happens to use the same stylesheet as the template, so it DEFINITELY needs to change.

      @Jerome: I’ll consider it. I actually thought it was on full data. However, this resists scrapers a lot more, and also allows me to keep accurate traffic stats. I gauge what topics to write about by the percentage of my RSS scubscribers that click the link.

    6. xlspecial says:

      Nice share XMCP. Sent a comment earlier but apparently it didn’t go through. Had some code in it so it probably got bounced.

      Thanks for this.

    7. Domen Lombergar says:

      Interesting. One question though - wouldn’t it be far more useful if you did it on a per-page basis? I dunno, perhaps calculate the md5 of the url, then do the same thing. The result would be all of the different version of the links on the same domain.

    8. Seller Girl says:

      Umm, dude, just to simplify things a bit - you don’t need to muck around with a seed anymore, unless you’re using a pre V4.2 PHP :)
      Its automatically randomises now :)

    9. itchy says:

      nice. any thoughts on how to upscale that to a larger scale? after all the code works great when you have just a few sites to work with but becomes impractical when you have thousands. so far i’ve got scrape the meta keywords at build (if you have more than one that is) or two, randomize the sites keywords swinging 50% towards the main page optimized term.

    10. admin says:

      @SellerGirl: But I want to..I want static anchor text on any given domain, so it doesn’t throw any Google red flags. Constantly changing anchor text is not my friend
      @itchy: Even on a large scale, 10-20 anchor texts per domain should be more than enough to not throw the google bomb filters.
      @doman: Yes, it works well like that too. I favor doing it by domain, but others can do more.
      @XLSpecial: Yeah, sorry about that. Mucking around with my comment settings apparently needs to continue.

    11. xlspecial says:

      No worries dude.

      Quick question concerning what I posted above. I set it up like shown, just changing the links and anchoir text, but for some reason it only shows the links/anchor for the first and third options. none for the second/middle one. Is it a simple fix to make this work with more links? Certainly don’t expect you to recode it or anything, just curious if it’s only a setting or two that needs to be changed.

      Thanks again.

    12. Seller Girl says:

      XMCP: “But I want to..I want static anchor text on any given domain, so it doesn’t throw any Google red flags. Constantly changing anchor text is not my friend”

      Ah, thats different and an excellent reason to do it. I’ve done the same thing with different techniques - sorry, didn’t pickup on the reasoning from the description :)

    13. Friday Tea Time - 2/1/08 says:

      […] My new favorite blogger, who’s probably younger than you: Anchor text shuffler for your link bombing box. A non-shady post on what to do if your rankings crash. And finally for […]

    14. thomas e says:

      very interesting, I suspect some people might have less “ethical” uses for it, though;)

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

    Marketing & SEO Blogs - Blog Top Sites
    © Slightly Shady SEO, All Rights Reserved. Scrape me, and I will eat your soul.