1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // movable type <?php $cnt =3; //表示件数 foreach ( $xml ->channel->item as $item ) { $url = $item ->link; $wtime = date ( "Y/m/d H:i:s" , strtotime ( $item ->pubDate)); echo '<h3><a href="' . $url . '">' . $item ->title. "</a></h3>" ; echo '<div id="blogtime"><h4>' . $wtime . '</h4></div>' ; echo '<div id="blogkiji"><p>' . $item ->description. '</p></div>' ; echo ' '; $cnt --; if ( $cnt <=0){ break ; } } ?> |
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 | // wordpress ブログ <?php $cnt =3; //表示件数 foreach ( $xml ->channel->item as $item ) { if ( strstr ( $item ->title, "[PR]" )){ } else { $url = $item ->link; $wtime = date ( "Y/m/d H:i:s" , strtotime ( $item ->pubDate)); echo '<h3><a href="' . $url . '">' . $item ->title. "</a></h3>" ; echo '<div id="blogtime"><h4>' . $wtime . '</h4></div>' ; echo '<div id="blogkiji"><p>' . $item ->description. '</p></div>' ; echo ' '; $cnt --; } if ( $cnt <=0){ break ; } } ?> |
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 | // seesaa ブログ, // eshizuoka ブログは "http://hogehoge.eshizuoka.jp/index.xml" <?php $cnt =3; //表示件数 foreach ( $xml ->channel->item as $item ) { if ( strstr ( $item ->title, "[PR]" )){ } else { $url = $item ->link; $wtime = date ( "Y/m/d H:i:s" , strtotime ( $item ->pubDate)); echo '<h3><a href="' . $url . '">' . $item ->title. "</a></h3>" ; echo '<div id="blogtime"><h4>' . $wtime . '</h4></div>' ; echo '<div id="blogkiji"><p>' . $item ->description. '</p></div>' ; echo ' '; $cnt --; } if ( $cnt <=0){ break ; } } ?> |
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 | // JUGEM ブログ <?php //print_r($xml); $cnt =3; //表示件数 //foreach ( $xml->channel->item as $item) { foreach ( $xml ->entry as $item ) { if ( strstr ( $item ->title, "[PR]" )){ } else { $url = $item ->id; $wtime = date ( "Y/m/d H:i:s" , strtotime ( $item ->issued)); echo '<h3><a href="' . $url . '">' . $item ->title. "</a></h3>" ; echo '<div id="blogtime"><h4>' . $wtime . '</h4></div>' ; echo '<div id="blogkiji"><p>' . $item ->summary. '</p></div>' ; echo ' '; $cnt --; } if ( $cnt <=0){ break ; } } ?> |