-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfilter.php
More file actions
26 lines (22 loc) · 758 Bytes
/
Copy pathfilter.php
File metadata and controls
26 lines (22 loc) · 758 Bytes
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
<?php
require_once("ganon/ganon.php");
foreach (array('url') as $required) {
if (!isset($_GET[$required])) {
header('Content-Type: text/markdown; charset=UTF-8; variant=GFM');
header('Location: README.md');
exit();
}
}
$http_opts = array();
if (isset($_GET['user_agent'])) $http_opts['user_agent'] = $_GET['user_agent'];
$context = stream_context_create(array('http' => $http_opts));
$title = isset($_GET['title']) ? $_GET['title'] : "";
$rss = file_get_dom($_GET['url'], true, false, $context);
foreach($rss->select("item", false, true, true) as $item) {
if ($title != "" && stripos($item("title",0)->getPlainText(), $title) !== False) {
continue;
};
$item->delete();
}
header('Content-Type: text/xml');
print($rss);