root/dev/install/export/export_GRIEFWATCH.php @ 134

Revision 134, 0.9 KB (checked in by exi, 14 years ago)

Added standings-management.
Changed installer step 3 to only use POST data now.
Character portraits should now look a bit better.
Changed all smarty template requests to use a wrapper function.
Modified standard page for IGB.
Added php compat file to reduce minimal needed version to 4.0.9.

Line 
1<?php
2$host = 'http://guard.griefwatch.net/';
3$num_kills = 3480;
4$saveto = './mails';
5exit('please edit file before running');
6
7for ($i = 0; $i<=$num_kills; $i++)
8{
9    $kill = $i;
10    if (file_exists($saveto.'/'.$kill.'.txt'))
11    {
12        continue;
13    }
14    $url = $host.'?p=details&kill='.$kill;
15    echo "reading kill $kill<br>\n";
16    $content = file_get_contents($url);
17    $content = str_replace("\r\n", "", $content);
18    $content = str_replace("\n", "", $content);
19
20    $pattern = '^<div class="box" style="margin-top: 10px; display: none;" id="raw">.*?style="padding: 2px;">(.*?)<script type="text/javascript">^';
21    preg_match($pattern, $content, $raw);
22
23    $mail = strip_tags(str_replace('<br>', "\r\n", $raw[1]));
24
25    if ($kill)
26    {
27        $fp = fopen($saveto.'/'.$kill.'.txt', "w");
28        fwrite($fp, $mail);
29        fclose($fp);
30        flush();
31    }
32}
33?>
Note: See TracBrowser for help on using the browser.