|
Тема |
Re: rss за darıknews [re: eba] |
|
Автор |
Kpивиндeл (пазя си нервите) |
|
Публикувано | 24.01.08 00:46 |
|
|
Отчайващ си! Махни го тоя ник, всички е*ем, то се подразбира :)
Пробвай SimplePie, за dnes.bg е работило при мен, виж примера.
В отговор на:
<?
$rs[0] = 'http://www.dnes.bg/rss.php?top';
$rs[1] = 'http://www.dnes.bg/rss.php?most';
$rs[2] = 'http://www.dnes.bg/rss.php?last';
$rnum = rand(0,2);
$rss_url = $rs["$rnum"];
require_once('php/simplepie.inc');
$feed = new SimplePie($rss_url);
$feed->set_output_encoding('Windows-1251');
$feed->init();
$feed->handle_content_type();
//Main data about this feed
?>
<div class="leftGray02"><h1>Актуални новини от Dnes.bg</h1></div>
<div class="searchBody">
<div class="quickSearch">
<ul class="news_feed">
<?
//Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
foreach ($feed->get_items() as $item):
?>
<li><a href="<?php echo $item->get_permalink(); ?>" target="_blank" class="news_new"><? echo $item->get_title(); ?></a></li>
<? endforeach; ?>
</ul>
</div>
</div>
Редактирано от Kpивиндeл на 24.01.08 00:47.
|
| |
|
|
|