-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.php
More file actions
54 lines (46 loc) · 1.63 KB
/
rss.php
File metadata and controls
54 lines (46 loc) · 1.63 KB
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
<?php
include 'OverpassDiff.php';
$overpass = new OverpassDiff();
$overpass->code =
'{{geocodeArea:Hungary}}->.searchArea;
(
node["amenity"="place_of_worship"]["religion"="christian"]["denomination"~"catholic"](area.searchArea);
way["amenity"="place_of_worship"]["religion"="christian"]["denomination"~"catholic"](area.searchArea);
relation["amenity"="place_of_worship"]["religion"="christian"]["denomination"~"catholic"](area.searchArea);
);';
if($overpass->buildQuery()) {
if($overpass->runQuery()) {
$rows = $overpass->diff();
} else {
$rows = array();
}
} else {
$rows = array();
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0">
<channel>
<title>Catholic Churches - OverpassDiff</title>
<description>Take a look at some of FeedForAll's favorite software and resources for learning more about RSS.</description>
<link>https://github.com/borazslo/OSM-Overpass-Diff</link>
<language>en-us</language>
<lastBuildDate><?php echo date('D, j M Y H:i:s') ?></lastBuildDate>
<pubDate><?php echo date('D, j M Y H:i:s') ?></pubDate>
<generator>OSM Overpass Diff</generator>
<?php
foreach($rows as $row) {
if(isset($row['timestamp']) AND $row['timestamp'] != '' ) {
echo' <item>
<title>['.$row['action'].'] '.$row['type'].':'.$row['id'].'</title>
<description>';
echo htmlentities("<pre>".print_r($row['diff'],1)."</pre>");
echo '</description>
<link>http://openstreetmap.org/'.$row['type'].'/'.$row['id'].'</link>
<pubDate>'.date('D, j M Y H:i:s +0200',strtotime($row['timestamp'])).'</pubDate>
</item>'."\n";
}
}
?>
</channel>
</rss>