neige d'aoust

knowledge, art, and other stuff

User Tools

Site Tools


tarpit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tarpit [2025/02/11 16:20] – created Yukitarpit [2025/02/12 01:16] (current) Yuki
Line 1: Line 1:
 +~~NOCACHE~~
 <php> <php>
-$words = explode("\n", file_get_contents("/usr/share/dict/american-english"));+// This creates infinite links for crawler bots to follow, full of absolute nonsense so AI can choke on it. Basically, it just picks words from a dictionary at random from a set seed. 
 +// Script by Yuki, licensed under LiLiQ-R. Feel free to use it on your site! 
 +// http://yuki.social/wiki/ 
 + 
 +$dict = "/usr/share/dict/american-english"
 +$count_min = 2000; 
 +$count_max = 5000; 
 +$linkcount_min = 2; 
 +$linkcount_max = 8; 
 +$paragraphs = 250; 
 + 
 +// Config ends here, but the fun is only starting. 
 + 
 +$words = explode("\n", file_get_contents($dict)); 
 +$num_words = count($words); 
 $seed = 0; $seed = 0;
-$count 500;+ 
 +if(isset($_GET["_"])) 
 +
 +  $strs explode("-", $_GET['_']); 
 +  $nums = array_map(fn($s) => array_search($s, $words), $strs); 
 +  $j=1; 
 +  $seed = array_reduce($nums, fn($c, $i) => $c + $i * $num_words ** ++$j); 
 +}
  
 mt_srand($seed); mt_srand($seed);
-for($i=0;$i<$count;$i++)+for($i=0;$i<mt_rand($count_min,$count_max);$i++) 
 +
 +  echo $words[mt_rand(0,$num_words)].(mt_rand(0,$paragraphs)==0?"<br/><br/>":" "); 
 +
 + 
 +$links = []; 
 +for($i=1;$i<=mt_rand($linkcount_min,$linkcount_max);$i++)
 { {
-  echo $words[mt_rand(0,count($words))]." ";+  $nums = []; 
 +  $n = mt_rand(); 
 +  while($n > 0
 +  { 
 +    $nums[] = $n % $num_words; 
 +    $n = intdiv($n,$num_words); 
 +  } 
 +  $w = implode("-", array_map(fn($s) => $words[$s], $nums))
 +   
 +  $links[= "<a href=\"?_=".$w."\">".$i."</a>";
 } }
 +echo "<br/><br/>".implode(" / ", $links);
 </php> </php>
tarpit.1739308833.txt.gz · Last modified: 2025/02/11 16:20 by Yuki