<?
$query = "INSERT INTO items (Item_Category, Item_Image, Item_Title, Item_Description) VALUES ";
$data = array();
for($i = 0; $i<1;$i++){
$contents = file_get_contents('http://www.gamespot.com/games....asc&official=all&page=' . $i);
preg_match_all('/<th>\n <a href="http:\/\/www.gamespot.com\/(.*)\/(.*)\/(.*)\/index.html">(.*)<\/a>\n <\/th>/', $contents, $matches);
foreach($matches[4] as $key => $value){
$contents_new = str_replace('<a href="', '', $matches[0][$key]);
$contents_new = str_replace('</a>', '', $contents_new);
$contents_new = str_replace('<th>', '', $contents_new);
$contents_new = str_replace($value, '', $contents_new);
$contents_new = str_replace('">', '', $contents_new);
$contents_new = str_replace('</th>', '', $contents_new);
$url = str_replace(' ', '', $contents_new);
$cat = mt_rand(1, 4);
$datas = array('URL' => $url, 'Game' => $value, 'Category' => $cat);
$data[] = $datas;
}
}
foreach($data as $key => $value){
file_get_contents($value['URL']);
}
?>
[Ovu poruku je menjao flylord dana 30.05.2011. u 09:28 GMT+1]