-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (35 loc) · 1016 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
set_time_limit(500);
ini_set('memory_limit', '512M');
require 'markov.php';
require 'titlesTable.php';
require 'titlesBegin.php';
require 'plotsTableLighter.php'; // I used a light version for performance reasons
require 'plotsBeginLighter.php';
?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>1001 Plots by WhiteFangs</title>
</head>
<body>
<?php
for($i = 0; $i < 1001; $i++){
$titleWords = rand(1, 4);
$title = generate_markov_text($titleWords, $titlesTable, $titlesBegin);
$title = substr($title, 0, -1);
$title = str_ireplace(".. ", rand(0, 1) ? ", " : ": ", $title);
$title = str_ireplace(". ", rand(0, 1) ? ", " : ": ", $title);
if(substr($title, -1) == "," || substr($title, -1) == ":")
$title = substr($title, 0, -1);
echo '<h1>';
echo $title;
echo '</h1>';
echo '<p>';
echo generate_markov_text(rand(50, 250), $plotsTable, $plotsBegin);
echo '</p>';
}
?>
</body>
</html>