File: feed-proxy.php

package info (click to toggle)
icinga-web 1.7.1%2Bdfsg2-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 83,496 kB
  • sloc: php: 252,926; xml: 142,251; sql: 8,190; sh: 1,039; makefile: 575; perl: 215; python: 194
file content (12 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
<?php
// this is an example server-side proxy to load feeds
$feed = $_REQUEST['feed'];
if($feed != '' && strpos($feed, 'http') === 0){
	header('Content-Type: text/xml');
	$xml = file_get_contents($feed);
	$xml = str_replace('<content:encoded>', '<content>', $xml);
	$xml = str_replace('</content:encoded>', '</content>', $xml);
	$xml = str_replace('</dc:creator>', '</author>', $xml);
	echo str_replace('<dc:creator', '<author', $xml);
	return;
}