diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -75,14 +75,14 @@ print_header("", "home"); $news_reachable = apcu_fetch('news_reachable', $apcu_success); if ($apcu_success == false) { - if (site_is_reachable('https://news.archlinux32.org/rss.php')) + if (site_is_reachable('https://bbs.archlinux32.org/extern.php?action=feed&fid=12&type=atom')) $news_reachable = 'YES'; else $news_reachable = 'NO'; apcu_store('news_reachable', $news_reachable, 300); } if ($news_reachable == 'YES') { - $ch = curl_init('https://news.archlinux32.org/rss.php'); + $ch = curl_init('https://bbs.archlinux32.org/extern.php?action=feed&fid=12&type=atom'); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); @@ -108,10 +108,10 @@ if ($news32 === false) { } else { foreach($news32 -> {'entry'} as $entry) { $news[] = array ( - 'content' => $entry -> {'content'}, - 'date' => explode('T', $entry -> {'published'})[0], - 'link' => $entry -> {'link'} -> attributes() -> {'href'}, - 'title' => $entry -> {'title'} + 'content' => preg_replace('#^<p>By [^<]*<br />On [^<]*</p>#', '', $entry -> {'summary'} -> __toString()), + 'date' => explode('T', $entry -> {'updated'} -> __toString())[0], + 'link' => $entry -> {'link'} -> attributes() -> {'href'} -> __toString(), + 'title' => $entry -> {'title'} -> __toString() ); } } |