GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — p2-php/read_rss.php at master · thermon/p2-php Expand file tree/ Copy pathread_rss.phpMore file actions 107 lines (87 loc) · 2.88 KB / Copy pathread_rss.phpFile metadata and controls107 lines (87 loc) · 2.88 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 <?php /** * rep2expack - 簡易RSSリーダ(<description>または<content:encoded>の内容を表示) */ // {{{ p2基本設定読み込み&認証 require_once './conf/conf.inc.php'; $_login->authorize(); // }}} if ($_conf['view_forced_by_query']) { output_add_rewrite_var('b', $_conf['b']); } //============================================================ // 変数の初期化 //============================================================ $_info_msg_ht = ''; $channel = array(); $items = array(); $num = trim($_REQUEST['num']); $xml = trim($_REQUEST['xml']); $atom = empty($_REQUEST['atom']) ? 0 : 1; $site_en = trim($_REQUEST['site_en']); if (is_numeric($num)) { $num = (int)$num; } $xml_en = rawurlencode($xml); $xml_ht = htmlspecialchars($xml, ENT_QUOTES, 'Shift_JIS', false); //============================================================ // RSS読み込み //============================================================ if ($xml) { require_once P2EX_LIB_DIR . '/rss/parser.inc.php'; $rss = p2GetRSS($xml, $atom); if ($rss instanceof XML_Parser) { clearstatcache(); $rss_parse_success = true; $xml_path = rss_get_save_path($xml); $mtime = filemtime($xml_path); $channel = $rss->getChannelInfo(); $items = $rss->getItems(); $fp = fopen($xml_path, 'rb'); $xmldec = fgets($fp, 1024); fclose($fp); if (preg_match('/^<\\?xml version="1.0" encoding="((?i:iso)-8859-(?:[1-9]|1[0-5]))" ?\\?>/', $xmldec, $matches)) { $encoding = $matches[1]; } else { $encoding = 'UTF-8,CP51932,CP932,JIS'; } mb_convert_variables('CP932', $encoding, $channel, $items); } else { $rss_parse_success = false; } } else { $rss_parse_success = false; } //=================================================================== // HTML表示用変数の設定 //=================================================================== //タイトル if (isset($num)) { $title = htmlspecialchars($items[$num]['title'], ENT_QUOTES, 'Shift_JIS', false); } else { $title = htmlspecialchars($channel['title'], ENT_QUOTES, 'Shift_JIS', false); } //============================================================ // HTMLプリント //============================================================ if ($_conf['ktai']) { if (!$_conf['expack.rss.check_interval']) { // キャッシュさせない P2Util::header_nocache(); } else { // 更新チェック間隔の1/3だけキャッシュさせる(端末orゲートウェイの実装依存) header(sprintf('Cache-Control: max-age=%d', $_conf['expack.rss.check_interval'] * 60 / 3)); } } echo $_conf['doctype']; include P2EX_LIB_DIR . '/rss/' . ($_conf['ktai'] ? 'read_k' : 'read') . '.inc.php'; /* * Local Variables: * mode: php * coding: cp932 * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: nil * End: */ // vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |