Created
February 22, 2013 07:37
-
-
Save gklka/5011530 to your computer and use it in GitHub Desktop.
beszeljukmac.com RSS fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_GET['url']) { | |
$url = $_GET['url']; | |
} else { | |
$url = "http://beszeljukmac.com/index.php/rss/hirek"; | |
} | |
$page = file_get_contents($url); | |
$page = iconv("ISO-8859-2", "UTF-8", $page); | |
$page = str_replace("iso-8859-2", "utf-8", $page); | |
if (!$_GET['url']) { | |
$page = str_replace("<link>http://beszeljukmac.com", "<link>http://gk.lka.hu/beszmacrss.php?url=http://beszeljukmac.com", $page); | |
$page = str_replace('<guid isPermaLink="true">http://beszeljukmac.com', '<guid isPermaLink="true">http://gk.lka.hu/beszmacrss.php?url=http://beszeljukmac.com', $page); | |
header("Content-Type:text/xml; charset=utf-8"); | |
} else { | |
$tmp = split('<div class="article" style="border-bottom:none;">', $page); | |
$tmp = $tmp[1]; | |
$tmp = split('<div class="articlecategory">', $tmp); | |
$tmp = $tmp[0]; | |
$tmp = str_replace('class="commentsSocial"', 'class="commentsSocial" style="display:none;', $tmp); | |
$tmp = str_replace('class="articleauthor"', 'class="articleauthor" style="display:none;"', $tmp); | |
$tmp = str_replace('class="articlecomments"', 'class="articlecomments" style="display:none;"', $tmp); | |
$tmp = str_replace('class="facebookLike"', 'class="facebookLike" style="display:none;"', $tmp); | |
$tmp = str_replace('class="tweetLike"', 'class="tweetLike" style="display:none;"', $tmp); | |
$page = "<html><body>" . $tmp . "</div></body></html>"; | |
header("Content-Type:text/html; charset=utf-8"); | |
} | |
print $page; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment