set_feed_url(array(
'http://event.makusta.jp/feed/',
'http://makunavi.makusta.jp/pickup/feed/',
'http://blogs.makusta.com/president/feed/',
'http://blogs.makusta.com/sports/feed/',
'http://blogs.makusta.com/makucal/feed/',
'http://makustaff.makusta.jp/feed/',
'http://work.makusta.jp/feed/',
'http://blogs.makusta.com/imogamisama/feed/',
'http://blogs.makusta.com/chiyo/feed/',
'http://blogs.makusta.com/infoboard/feed/',
'http://blogs.makusta.com/curry/feed/'
)); // フィードリスト
$feed->set_item_limit(1); // 各フィードから表示する記事数
$feed->set_cache_location('cache'); // Cache ディレクトリ
$feed->enable_cache(true); // Cacheあり
$feed->set_cache_duration(1800); // Cache保存期間
$feed->init(); // パースを実行
$feedItems=$feed->get_items(0,5); // 表示件数を指定(この場合5個)
$feed->handle_content_type();
foreach($feedItems as $item){
$date = $item->get_date('Y年m月d日'); // 各記事の日付
$title = $item->get_title(); // 各記事のタイトル
$link = $item->get_link(); // 各記事のURL
$sitename = $item->get_feed()->get_title(); // サイトのタイトル
$contents = $item->get_description(); //記事説明
// $item->get_content() の中からimgタグを抽出
if(preg_match('|src="(.*?).jpg"|i', $item->get_content(), $match)){
$img = '
';
} else {
// 画像がないときの処理
if(preg_match('|src="(.*?).png"|i', $item->get_content(), $match)){
$img = '
';
} else {
$img = '
';
}
}
// コンテンツここから
echo "";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
echo "
";
}
?>