1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP script for Spin Text??

Discussion in 'Black Hat SEO Tools' started by putrasandy, Jan 12, 2012.

Tags:
  1. putrasandy

    putrasandy Regular Member

    Joined:
    Sep 26, 2010
    Messages:
    219
    Likes Received:
    11
    Hi, does anyone knows custom PHP script or other tool to do easy spinning like this:

    alex
    robert
    jane
    nicolas
    martha
    andy

    becoming like this:
    {alex|robert|jane|nicolas|martha|andy}

    I can do it manually with notepad, but wondering the best way to automate this become more effective n efficient..
    Note: i just want little, tiny tools...


    Thanks
     
    Last edited: Jan 12, 2012
  2. putrasandy

    putrasandy Regular Member

    Joined:
    Sep 26, 2010
    Messages:
    219
    Likes Received:
    11
    bump! :D
    anyone?
     
  3. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    Here you go, a very basic text spin function:
    PHP:
    <?php

    function spinText($text){
        
    $test preg_match_all("#\{(.*?)\}#"$text$out);

        if (!
    $test) return $text;

        
    $toFind = Array();
        
    $toReplace = Array();

        foreach(
    $out[0] AS $id => $match){
        
    $choices explode("|"$out[1][$id]);
        
    $toFind[]=$match;
        
    $toReplace[]=trim($choices[rand(0count($choices)-1)]);
        }

        return 
    str_replace($toFind$toReplace$text);
    }

    echo 
    spinText("Hello {world|BHW}!");;

    ?>
     
  4. hellohellosharp

    hellohellosharp Power Member

    Joined:
    Dec 8, 2010
    Messages:
    625
    Likes Received:
    552
    Occupation:
    CEO @ CLEANFILES LLC
    Location:
    USA
    Home Page:
    is the php meant to DO the spnning or just put it into spintax format?
     
  5. putrasandy

    putrasandy Regular Member

    Joined:
    Sep 26, 2010
    Messages:
    219
    Likes Received:
    11
    Hi, how this script work? I did upload to my host then run it. But nothing to work.. am I did it wrong?

    Not spinning, just convert to spintax format. any clue?
    I have know nothing about php :D
     
  6. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    Ahh.. I misunderstood what you were asking for. That PHP will do the spinning.

    Why do you want a PHP solution? IMO for any type of simple text manipulation like that it's gonna be way easier to just use notepad++ or something similar. Find and replace the line breaks with pipes and wrap it in curly brackets. KISS :D
     
    • Thanks Thanks x 1
  7. putrasandy

    putrasandy Regular Member

    Joined:
    Sep 26, 2010
    Messages:
    219
    Likes Received:
    11
    Ah.. I use notepad++ everyday.. that's why I ask.lol... i want to automate it, cause i working on spintax everyday..
     
  8. themidiman

    themidiman Power Member

    Joined:
    Feb 25, 2011
    Messages:
    701
    Likes Received:
    1,536
    Location:
    root@pts/0
    • Thanks Thanks x 4
  9. putrasandy

    putrasandy Regular Member

    Joined:
    Sep 26, 2010
    Messages:
    219
    Likes Received:
    11
    • Thanks Thanks x 1
  10. mamadou

    mamadou Newbie

    Joined:
    Jun 1, 2013
    Messages:
    26
    Likes Received:
    3
    themidiman putrasandy I'm Sorry to bump this old thread .. but can you guys re-upload this tool if you still have it ?