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
52
53
54
55
56
57
58
59
60
61
|
<?php
//todayinhistory.php
error_reporting(0);
define("MARKER_START","<h3>On this day…</h3>");
define("MARKER_END","<hr /> <h3>Holidays</h3>");
define("BIRTHDAY_START","");
define("BIRTHDAY_END","<hr /> <h3>Deaths which occurred on ".date("F d").":</h3>");
define("DEATH_START","<hr /> <h3>Deaths which occurred on ".date("F d").":</h3>");
define("DEATH_END","<hr /> <img src=\"http://www.scopesys.com/flag.gif\" alt=\"\" align=\"left\" />");
define("HOLIDAYS_START","<i>Note: Some Holidays are only applicable on a given <b>\"day of the week\"</b></i>");
define("HOLIDAYS_END","<hr /> <h3>Religious Observances</h3>");
define("RELIGIOUS_START","<hr /> <h3>Religious Observances</h3>");
define("RELIGIOUS_END","<hr /> <h3>Religious History</h3>");
define("RELHISTORY_START","<hr /> <h3>Religious History</h3>");
define("RELHISTORY_END","<span style=\"color: red;\">");
echo "<h2>Today is ".Date("F d, Y")."</h2>";
$data = file_get_contents("http://www.scopesys.com/today");
if ($_GET['history']==’1′) {
echo "<h2>Today in history</h2>";
$end = strpos($data,MARKER_END)-15;
$start = strpos($data,MARKER_START)+strlen(MARKER_START);
echo substr($data,$start,$end-$start);
}
if ($_GET['born']==’1′) {
echo "<h2>Who’s born today</h2>";
$end = strpos($data,BIRTHDAY_END);
$start = strpos($data,BIRTHDAY_START)+strlen(BIRTHDAY_START);
echo substr($data,$start,$end-$start);
}
if ($_GET['died']==’1′) {
echo "<h2>Who died today</h2>";
$end = strpos($data,DEATH_END);
$start = strpos($data,DEATH_START)+strlen(DEATH_START);
echo substr($data,$start,$end-$start);
}
if ($_GET['holiday']==’1′) {
echo "<h2>Where is holiday today</h2>";
$end = strpos($data,HOLIDAYS_END);
$start = strpos($data,HOLIDAYS_START)+strlen(HOLIDAYS_START);
echo substr($data,$start,$end-$start);
}
if ($_GET['religious']==’1′) {
echo "<h2>Religious observance</h2>";
$end = strpos($data,RELIGIOUS_END);
$start = strpos($data,RELIGIOUS_START)+strlen(RELIGIOUS_START);
echo substr($data,$start,$end-$start);
}
if ($_GET['relhistory']==’1′) {
echo "<h2>Religious history</h2>";
$end = strpos($data,RELHISTORY_END);
$start = strpos($data,RELHISTORY_START)+strlen(RELHISTORY_START);
echo substr($data,$start,$end-$start);
}
?>
|