The latest news with 3DNews


To the address www.3dnews.ru/news/ we shall find weight of interesting news, they are updated almost each hour. All news are not necessary for us, it is too bulky, but we can take latest of displayed on a site. For this purpose we make already mastered procedure: we come on page, we open and we read its  initial code. Unfortunately, here it more and more confusing, than on site MK. We find the first heading of news and we look, than he is unique, defining{determining} on a course, what information will always remain static in spite of the fact that all news different in the sizes and can have a picture or the link or different authors. Perhaps, our choice will be formatting the heading - a characteristic code from which the conclusion will begin: <h1 class = "title_news">. The termination{ending} of news always comes to an end in the line Thematic links or Thematic clauses{articles}. That is, after each news in any case there will be a word "Thematic" - this line and becomes an attribute of the termination{ending} of news. Everything, now it is necessary to bring in little changes to our script that he has earned for a conclusion of last news with 3DNews only:



<? php


$www2 = @file (" http: // www.3dnews.ru/news / ");

$www = ";


for ($j=0; $j <count ($www2); $j ++)

$www. = $www2 [$j];


$begin = strpos ($www, ' <h1 class = "title_news"> ');

$endl = strpos ($www, 'Thematic');


for ($i = $ begin; $i <$endl; $i ++)

echo $www [$i];

?>


All the line long a code to you the information part is already familiar, changed only.