Anyone have a spintax script?

FuryFit

Regular Member
Joined
Oct 19, 2011
Messages
206
Reaction score
33
I'm looking for a script I can include in my site's template, which will read an article in spintax and output the spun version when the page is viewed.

It could be CPU intensive but i figure it will be ok once most of the affected urls are cached.
 
Which programming language?
Here's PHP function i use, it supports nested spintax. Grab article with $spintext = file_get_contents( $path_to_article ).

PHP:
function spintext_spin( $spintext )
{
	preg_match( '#\{(.+?)\}#is', $spintext, $tmp );
	if( empty( $tmp ) ): return $spintext; endif; # >>>
	$tmp = $tmp[1];
	if( strpos( $tmp, '{') !== false ):
		$tmp = substr( $tmp, strrpos( $tmp, '{' ) + 1 );
	endif;
	$parts = explode( '|', $tmp );
	$spintext = preg_replace( "+\{" . preg_quote( $tmp ) . "\}+is", $parts[array_rand( $parts )], $spintext, 1 );
	return spintext_spin( $spintext );
}
 
Are you sure that there's no Plugin with this function?

Search for Spintax using WP Plugin search. As i can remember, i found one in past.
 
Back
Top