コンテンツ・声優

お正月、千歌:こたつ(おこた)におこもり 凛:公園で凧揚げ【毎日劇場1229】

スクスタ
星空凛
毎日劇場
高海千歌
1: 2020/12/29(火) 00:05:26.10 ID:iWpaUxK9 なんか懐かしい…?
0

栞子さん、甘酒が大好きだった【毎日劇場1228】

スクスタ
三船栞子
南ことり
毎日劇場
雑談ー虹ヶ咲
1: 2020/12/28(月) 00:04:31.11 ID:5q9v9ZyW 甘酒! 大好きです! 行きたいです! テンションアゲアゲじゃねえか 2: 2020/12/28(月) 00:05:16.34 ID:NekVpHbq 米麹と酒...
0

果林先輩、ペットボトルの蓋をつけっぱなしで飲もうとする瞬間をSNSに上げられてしまう【毎日劇場1227】

スクスタ
キャラクターー虹ヶ咲
朝香果林
毎日劇場
1: 2020/12/27(日) 00:06:16.45 ID:qGiGbku8 なにしてくれてんだ…
0

【朗報】藤丸くん、公式絵【ラブライブ!虹ヶ咲】

スクスタ
最新情報・速報
毎日劇場
1: 2020/12/27(日) 00:04:53.57 ID:JUS5pyCi (5ch newer account)
0

スクールアイドル同好会、10人でクリスマスパーティー【毎日劇場1226】【ラブライブ!】

スクスタ
キャラクターー虹ヶ咲
毎日劇場
81: 2020/12/26(土) 00:06:15.75 ID:2oxMRKXC0 10人で来たか 94: 2020/12/26(土) 00:32:49.31 ID:aHHWiCPZ0
0

曜ちゃん、花丸ちゃんとナイショのプレゼント交換♡【毎日劇場1225】

スクスタ
国木田花丸
毎日劇場
渡辺曜
1: 2020/12/25(金) 10:03:49.23 ID:HvgyIN+B ずらぁ~
0

【ラブライブ!】【画像】半回転捻りギャラクシーすき【Liella!】

ネタ・雑談
アニメーLiella!
すこし前の記事・話題
平安名すみれ
雑談ースーパースター!!
1:名無しで叶える物語(もんじゃ) 2021/09/20(月) 15:48:05.40 ID:heoEeaAr
0
   

タイトルとURLをコピーしました
/** * Reddit RSS抽出・キャッシュ保存 最終最適化版 */ add_shortcode('red', function($atts) { global $post; $url = isset($atts['url']) ? $atts['url'] : ''; if (empty($url)) return ''; // キャッシュキーの作成 $url_hash = md5($url); $cache_key = 'reddit_v4_' . $url_hash; $cached_data = get_transient($cache_key); if ($cached_data === false) { $display_text = ''; $rss_url = rtrim($url, '/') . '/.rss'; include_once(ABSPATH . WPINC . '/feed.php'); $rss = fetch_feed($rss_url); if (!is_wp_error($rss)) { // URLからコメントIDを取得 (例: o2hi14v) $url_parts = explode('/', rtrim($url, '/')); $comment_id = end($url_parts); $items = $rss->get_items(0, 10); foreach ($items as $item) { // RSSの (例: t1_o2hi14v) にコメントIDが含まれているかチェック if (strpos($item->get_id(), $comment_id) !== false) { $display_text = $item->get_content(); break; } } // 特定のコメントが見つからない場合は、最新の投稿内容を取得 if (empty($display_text) && isset($items[0])) { $display_text = $items[0]->get_content(); } } if (!empty($display_text)) { // 1. HTMLデコードしてタグを除去 $display_text = html_entity_decode($display_text); // 2. 不要な [link] や [comments] のリンクテキストを削除 $display_text = preg_replace('/\[link\]|\[comments\]|\[個のコメント\]/u', '', $display_text); // 3. 投稿者情報の削除 $display_text = preg_replace('/submitted by.*/i', '', $display_text); // 4. 余分なタグを除去し、改行を整える $display_text = strip_tags($display_text); $display_text = trim($display_text); } else { $display_text = 'Check the original post for details.'; } // 12時間キャッシュを保存 set_transient($cache_key, $display_text, 12 * HOUR_IN_SECONDS); $cached_data = $display_text; } // ウィジェットJS wp_enqueue_script('reddit-widgets', 'https://embed.reddit.com/widgets.js', array(), null, true); $html = '
'; $html .= '
'; $html .= '
'; $html .= '

【原文・翻訳】

'; $html .= '
' . esc_html($cached_data) . '
'; $html .= '
'; return $html; });