-
Notifications
You must be signed in to change notification settings - Fork 37
/
fortuneteller.php
51 lines (41 loc) · 1.45 KB
/
fortuneteller.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
43
44
45
46
47
48
49
50
51
<?php
echo "<h2>For Thai Fortune: $req</h2>";
if (preg_match("~^\b(fortune|luck) (.+)\b~", $req, $match)) {
echo "<h2>Inside Thai Fortune: $req</h2>";
$data = explode('@*@', $match[2]);
var_dump($data);
$name = strtoupper(trim($data[0]));
$time = trim($data[1]);
$date = trim($data[2]);
$dateparts = explode('/', $date);
$d = $dateparts[0];
$m = $dateparts[1];
$y = $dateparts[2];
$newresult = newthai($d, $m, $y, $name);
$total_return = $newresult;
if (!empty($total_return)) {
$source_machine = $machine_id;
$current_file = "/temp/$numbers";
file_put_contents(DATA_PATH . $current_file, $total_return);
$to_logserver['source'] = 'luckyNO';
include 'allmanip.php';
putOutput($total_return);
exit();
}
}
function newthai($d, $m, $y, $name) {
$content = file_get_contents("API");
if (preg_match('~<div class="ruby">(.+)Synastry according to Typical analysis~Usi', $content, $match)) {
// var_dump($match);
$data = $match[1];
$data = preg_replace('~[\s]+~', " ", $data);
$data = preg_replace('~Gender:<b>(.+)</b>~Usi', "", $data);
$data = str_replace('</div>', "***", $data);
$data = str_replace('</h3>', "***", $data);
$data = strip_tags($data);
$data = str_replace('***', "\n", $data);
$result = "Fortune for $name born on $data";
}
return $result;
}
?>