index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-11-14 11:28:58 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-11-14 11:28:58 +0100 |
commit | 4443e2dac2e6f2cc6fed530daaec5898db805d0b (patch) | |
tree | d667f05b0aa51e76d88e351e112458cf525bea0f | |
parent | 812c8671fdaa3abf62f01b31068ed8a291635aea (diff) |
-rw-r--r-- | index.php | 12 |
@@ -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() ); } } |