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

Your own article spinner in PHP!

Discussion in 'Black Hat SEO' started by phpbuilt, Aug 10, 2011.

  1. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    PHP:
    function spin($pass){
        
    $mytext $pass;
        while(
    inStr("}",$mytext)){
            
    $rbracket strpos($mytext,"}",0);
            
    $tString substr($mytext,0,$rbracket);
            
    $tStringToken explode("{",$tString);
            
    $tStringCount count($tStringToken) - 1;
            
    $tString $tStringToken[$tStringCount];
            
    $tStringToken explode("|",$tString);
            
    $tStringCount count($tStringToken) - 1;
            
    $i rand(0,$tStringCount);
            
    $replace $tStringToken[$i];
            
    $tString "{".$tString."}";
            
    $mytext str_replaceFirst($tString,$replace,$mytext);
        }
        return 
    $mytext;
    }
    function 
    str_replaceFirst($s,$r,$str){
        
    $l strlen($str);
        
    $a strpos($str,$s);
        
    $b $a strlen($s);
        
    $temp substr($str,0,$a) . $r substr($str,$b,($l-$b));
        return 
    $temp;
    }
    function 
    inStr($needle$haystack){
        return @
    strpos($haystack$needle) !== false;
    }
    Pass any block of text to the function "spin" and it will return your article, spun. Great for anyone who is developing their own system involving article spinning.

    Supports nested spinning to infinite levels.

    If you're sending articleranks.com spins to it, just convert "[" and "]" to "{" "}" ... and "~" to "|".

    BTW I wrote this myself. Use it however you want. Let me know if you have any questions.

    Enjoy!
     
    • Thanks Thanks x 38
    Last edited: Aug 11, 2011
  2. roxiea90

    roxiea90 Power Member

    Joined:
    Jun 28, 2011
    Messages:
    532
    Likes Received:
    127
    Occupation:
    Become Successful In This World And AfterLife
    Location:
    Secret
    how to use it?? sory im new to php
     
  3. GrizzlyAdams

    GrizzlyAdams Regular Member

    Joined:
    Feb 17, 2011
    Messages:
    479
    Likes Received:
    405
    Occupation:
    Freelancer
    Location:
    British Columbia
    cool man nice share, can you explain how it works?

    is it replacing a & b with different a & b characters?
     
  4. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    It works just like The Best Spinner or Spinner Chief for taking an article spin and turning it into a finished spun article.

    This code will allow you to use spun articles in your own programming. For instance, if you are writing your own software to send spun articles to wordpress blogs or bookmarking services ... this function will enable your software to spin articles as it submits.

    The Best Spinner has a port on it that people have to run it as a service so their software can receive spun text. The above function will allow you to bypass the need to do that, now you can spin right in your own programming.

    I use it in software I'm writing to automatically generate articles and send them to wordpress blogs and social bookmarking. Anyone doing that sort of thing will find this function very helpful.

    Just to be clear, this is not something made to replace The Best Spinner or Spinner Chief. Theoretically you could take this and hook a thesaurus up to it and some ajax to make your own versions of those software, but that's not what I use it for. I simply use it to spin articles in my own programming code.
     
    • Thanks Thanks x 2
    Last edited: Aug 10, 2011
  5. roxiea90

    roxiea90 Power Member

    Joined:
    Jun 28, 2011
    Messages:
    532
    Likes Received:
    127
    Occupation:
    Become Successful In This World And AfterLife
    Location:
    Secret
    oooh i see.. thanks
     
  6. ReggaeShark

    ReggaeShark Elite Member

    Joined:
    Jul 27, 2010
    Messages:
    1,952
    Likes Received:
    609
    Gender:
    Male
    Occupation:
    The Tea Seller
    Location:
    India
    any 1 tried this or not ?
     
  7. johndea

    johndea Regular Member

    Joined:
    Jun 23, 2011
    Messages:
    308
    Likes Received:
    35
    Where can I find a thesaurus?
     
  8. Deviant991

    Deviant991 Registered Member

    Joined:
    Jun 12, 2011
    Messages:
    51
    Likes Received:
    7
    For guys who aren't experienced with programming what this script do is:

    You have a text like:
    {A|B|C} likes {C|D} but not {E|F}

    After using this script you'll get :
    A likes D but not E
    C likes C but not F , etc
     
  9. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    Hold on I'm writing a whole sample php page that anyone can test it out. Will post in a second.
     
  10. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    PHP:
    <?php
    set_time_limit
    (10);
    function 
    inStr($needle$haystack){
        return @
    strpos($haystack$needle) !== false;
    }
    function 
    str_replaceFirst($s,$r,$str){
        
    $l strlen($str);
        
    $a strpos($str,$s);
        
    $b $a strlen($s);
        
    $temp substr($str,0,$a) . $r substr($str,$b,($l-$b));
        return 
    $temp;
    }
    function 
    spin($pass){
        
    $mytext $pass;
        while(
    inStr("}",$mytext)){
            
    $rbracket strpos($mytext,"}",0);
            
    $tString substr($mytext,0,$rbracket);
            
    $tStringToken explode("{",$tString);
            
    $tStringCount count($tStringToken) - 1;
            
    $tString $tStringToken[$tStringCount];
            
    $tStringToken explode("|",$tString);
            
    $tStringCount count($tStringToken) - 1;
            
    $i rand(0,$tStringCount);
            
    $replace $tStringToken[$i];
            
    $tString "{".$tString."}";
            
    $mytext str_replaceFirst($tString,$replace,$mytext);
        }
        return 
    $mytext;
    }

    echo 
    '<form action="" method="post"><textarea name="mypost" cols="80" rows="20">';

    if(isset(
    $_POST["mypost"])){
        echo 
    $_POST["mypost"];
    }
    echo 
    '</textarea><br /><input name="" type="submit" /></form>';

    if(isset(
    $_POST["mypost"])){
        
    $mypost $_POST["mypost"];
        
    $mypost str_replace("'","`",$mypost);
        
    $echoMe spin($mypost);
        
    $wordCount explode(" ",$echoMe);
        
    $wordCount count($wordCount);
        
    $echoMe str_replace(chr(13).chr(10),"<br />".chr(13).chr(10),$echoMe);
        echo 
    $echoMe;
        echo 
    "<br />";
        echo 
    "wordcount: <b>$wordCount</b>";

    }

    ?>
    Save that file on any php server, paste in your article spin and click submit. I'll show the spun content below the text box.
     
    • Thanks Thanks x 14
  11. blackhatjeiboy

    blackhatjeiboy Registered Member

    Joined:
    Jun 14, 2011
    Messages:
    77
    Likes Received:
    29
    Location:
    Somewhere in Asia
    wow nice dude, thanks a lot, is it possible to make a feature here something like bulk spin and export? or something like remove original like TBS?
     
  12. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    The code above I have this line of PHP:

    PHP:
        $echoMe spin($mypost);
    You could put that in a loop, save it as a text file with PHP. If you don't know PHP, just google for "php loop" and "php save file" will get you on the right track.

    But doesn't TBS or Spinner Chief have bulk exports that do this? The code above isn't really meant to replace either TBS or SC, it's made so you don't have to rely on either of those to take your finished spin and incorporate it into your own programming.

    For instance, I have built an XMLRPC submit tool that will post to any wordpress blog remotely. Using XMLRPC, you can schedule your posts. So, assuming you had the logins to 100 blog logins and each of those blogs have XMLRPC enabled, you could loop a spin 100 times, submitting to each of the blogs. This becomes a pain in the butt though ... if your code can't do the spin itself and has to rely on TBS or SC ... its much easier if your code can handle the spin before it sends to your blogs. That is why I wrote this for myself ... and there's dozens of opportunities like this to use the code in building linkwheels or networks.
     
    • Thanks Thanks x 1
    Last edited: Aug 11, 2011
  13. johndea

    johndea Regular Member

    Joined:
    Jun 23, 2011
    Messages:
    308
    Likes Received:
    35
    Does anyone have a synonym list for this software?
     
  14. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    The only reason you would need one is if you were intending to completely reprogram a web application similar to The Best Spinner or Spinner Chief, getting your hands on a thesaurus would only be the first step in a very long journey.

    The software above wasn't designed to help you create your spins. Its for using already finished spins.

    For instance ...

    Right now I'm programming an XMLRPC application to schedule posting articles to hundreds of wordpress blogs. Before the XMLRPC application sends the article, it creates it from spinner format into a readable article. Without the software I posted in original post, I wouldn't be able to spin the post before it got sent. That's what I use it for.

    Every place that accepts spun articles, like seolinkvine, articleranks, etc. ... every single one of them have a function for spinning your article. In other words, if you want to create a service like articleranks ... you need a function to spin text. That's what the PHP function I created does.

    Very few people will be helped by this post I'm sure (few people have need of a PHP spinner, everyone else can just use TBC or SC), but those few people I'm sure will be appreciative.
     
    • Thanks Thanks x 4
  15. CyHead

    CyHead Regular Member

    Joined:
    Apr 6, 2009
    Messages:
    237
    Likes Received:
    68
    Gender:
    Female
    Occupation:
    Student
    Location:
    Fiji
    Thanks for the code - I plugged in a thesaurus and tried to get it to write the spintax for me - but the quality came out pretty bad, got to figure out a way to refine it:

    Original:
    I have to work on how it treats punctuations and get a better word base.
     
    Last edited: Aug 14, 2011
  16. artlocke

    artlocke Regular Member

    Joined:
    May 28, 2010
    Messages:
    476
    Likes Received:
    120
    thanks for this it is really helpful. Anyway is it ok for me to ask a script of this that can spin articles using my own list of synonyms?. I understand if you can't give us a script like that if you think that what I'm asking is too much...

    Thanks and Rep given.. ^_^
     
  17. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    That's really cool, glad the code actually helped someone!

    I don't think it'll be that easy to automatically create spins based on a thesaurus ... the problem is various words have different meanings and it isn't easy to know which version is necessary.

    If you're that good of a programmer, might be a better idea to use programming to scrape various translation services to convert text from one language to another. Language software is built to understand the grammar and can usually lead to appropriate synonym replacements.

    I'm just trying to set myself up with hundreds of blogs, web2.0 properties and article directory accounts and send a spin article to each of them ... I just make the spins using regular spin software and use the code in the PHP to spin it before I post it.
     
  18. WordKey

    WordKey Junior Member

    Joined:
    Aug 9, 2011
    Messages:
    133
    Likes Received:
    126
    Location:
    Keyword Land
    Wouldn't this php spinner be slow?
     
  19. phpbuilt

    phpbuilt Jr. VIP Jr. VIP

    Joined:
    May 16, 2011
    Messages:
    1,656
    Likes Received:
    5,288
    Occupation:
    $ from websites I own.
    Location:
    putting monkeys in paypal
    Hmm, I'm not sure we're on the same page regarding what this script does. From the sound of your question, it seems as though you think it has the ability to take an un-spun article, and from that automatically create spin syntax inserting synonyms from a thesaurus. It doesn't do that at all.

    It does the exact opposite -- it takes an already existing spin and turns it into an article.

    I don't think its possible to take an article written in English and to automatically swap out synonyms on autopilot and still have it be readable -- if that could be done, TBS would have it by now (really anyone would make a fortune if they could do this).

    In reality, your "own list of synonyms" would be inserted into your finished spin syntax. In other words, if you use TBS or SC to create a spun article using a human created spun article that has all the appropriate synonyms chosen for every word ... that spin will work perfect in the PHP spinner. Then you can take your spin and do whatever you want to with it with programming (such as write automatic posting software).

    Not sure I answered your question properly, so if you still have a question let me know.
     
    Last edited: Aug 14, 2011
  20. artlocke

    artlocke Regular Member

    Joined:
    May 28, 2010
    Messages:
    476
    Likes Received:
    120
    oh sorry I taught that this script is for spinning un-spun articles as what you're title is saying "Your own article spinner in PHP!" I might misunderstood it though.