www.db.lv ziņu lasītājs

db.lv pēdējās ziņasŠorīt lasīju vienu ierakstu Boot forumā un secināju, ka PHP funkcijās file_get_contents un explode ir baigais spēks. Lai man šī atziņa uzreiz neaizmirstos, nolēmu uztaisīt www.db.lv pēdējo ziņu lasītāju.

<?
$start = '<div id="col3norubric">';
$end = '</a></li></ul></div></div></div>';
$base = "http://www.db.lv/";
$style = '<style type="text/css"> @import "/App_Themes/Online/style.css?version=38"; </style>';
$head = '<head><base href='.$base.'>'.$style.'</head>';
if ($dblv = @file_get_contents($base))
{
 $news = explode($start, $dblv);
 $news = explode($end, $news[1]);
 $news = str_replace("Pēdējās ziņas", "Ziņas no www.db.lv", $news);
 echo $head."<body><div id='col3'>".$news[0].$end."</body>";
}
?>

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Comments »

 
 

Pievienot komentāru

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*