ブログ更新情報
if(isKeitai() == FALSE){ // PC表示 $sepa = ' '; $sepa2 = ''; // 文字数を半角○文字まで。 $letter = 90; }else{ // 携帯表示 $sepa = ''; $sepa2 = '
'; // 文字数を半角○文字まで。 $letter = 40; } ?>
ショートカッツブログ 希美ログ fufu |
最新20件
// RSSを読み込み キャッシュ機能無し。いいよね。
$xml1 = simplexml_load_file('http://maruta.be/shortcuts/rss10.xml');
$xml2 = simplexml_load_file('http://rss.exblog.jp/rss/exblog/kimi3/index.xml');
//$xml3 = simplexml_load_file('http://blogs.myspace.com/Modules/BlogV2/Pages/RssFeed.aspx?friendID=1004142880'); // なくなった?2015/6 除外
$xml4 = simplexml_load_file('http://feedblog.ameba.jp/rss/ameblo/fufu-0327/rss20.xml'); // 追加 2015/6
foreach($xml1->item as $test){
$dc = $test->children('http://purl.org/dc/elements/1.1/');
$unixtime = strtotime($dc->date);
$blogs[] = array('blog' => 'ショートカッツブログ',
'title' => mb_convert_encoding($test->title, 'SJIS','UTF-8'),
'link' => $test->link,
'time' => $unixtime,
'description' => strip_tags(mb_convert_encoding($test->description, 'SJIS','UTF-8')),
'image' => 'image/icon_shortcutsblog.jpg',
);
}
foreach($xml2->channel->item as $test){
$unixtime = strtotime($test->pubDate);
if(!preg_match('/^PR: /', $test->title)){
// 希美ログはPRが入る。接頭辞「PR: 」
$blogs[] = array('blog' => '希美ログ',
'title' => mb_convert_encoding($test->title, 'SJIS','UTF-8'),
'link' => $test->link,
'time' => $unixtime,
'description' => strip_tags(mb_convert_encoding($test->description, 'SJIS','UTF-8')),
'image' => 'image/icon_kimilog.jpg',
);
}
}
/*
foreach($xml3->channel->item as $test){
$unixtime = strtotime($test->pubDate);
$blogs[] = array('blog' => 'MySpace',
'title' => mb_convert_encoding($test->title, 'SJIS','UTF-8'),
'link' => $test->link,
'time' => $unixtime,
'description' => strip_tags(mb_convert_encoding($test->description, 'SJIS','UTF-8')),
'image' => 'image/icon_MySpace.jpg',
);
}
*/
foreach($xml4->channel->item as $test){
$unixtime = strtotime($test->pubDate);
$blogs[] = array('blog' => 'fufu',
'title' => mb_convert_encoding($test->title, 'SJIS','UTF-8'),
'link' => $test->link,
'time' => $unixtime,
'description' => strip_tags(mb_convert_encoding($test->description, 'SJIS','UTF-8')),
'image' => 'image/icon_MySpace.jpg',
);
}
// ソート
//キーを指定してソート:日時降順
foreach ($blogs as $key => $val) {
$sort_key[$key] = $val['time'];
}
array_multisort( $sort_key, SORT_DESC, $blogs );
// 表示
$i=0;
foreach($blogs as $val){
$i++;
if($i > 20){
break;
}
// 文字数を半角○文字まで。
if((strlen($val['description']) > $letter)&&($letter)){
$val['description'] = mb_strcut($val['description'], 0, $letter, "SJIS") . "...";
}
?>
}
?>
(2024/4/25 19:45)
|