From 4443e2dac2e6f2cc6fed530daaec5898db805d0b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 14 Nov 2019 11:28:58 +0100 Subject: index.php: pull archlinux32 news from the forum rss instead of news.archlinux32.org --- index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index d0e7334..9dd1926 100644 --- a/index.php +++ b/index.php @@ -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('#^

By [^<]*
On [^<]*

#', '', $entry -> {'summary'} -> __toString()), + 'date' => explode('T', $entry -> {'updated'} -> __toString())[0], + 'link' => $entry -> {'link'} -> attributes() -> {'href'} -> __toString(), + 'title' => $entry -> {'title'} -> __toString() ); } } -- cgit v1.2.3