Notícias Policiais de Chapecó e Santa Catarina:


✔ Atualização: “.$data.”“;
echo “ Fonte: PM-SC
“;
echo $ja_registrado[0][2];
}
else{

$html = file_get_contents(‘http://www.pm.sc.gov.br/noticias/noticias-operacionais.html’);

//Create a new DOM document
$dom = new DOMDocument;

//Parse the HTML. The @ is used to suppress any parsing errors
//that will be thrown if the $html string isn’t valid XHTML.
@$dom->loadHTML($html);

//Get all links. You could also use any other tag name here,
//like ‘img’ or ‘table’, to extract other tags.
$links = $dom->getElementsByTagName(‘a’);

//Iterate over the extracted links and display their URLs
$contador = 0;
foreach ($links as $link){
$contador = $contador +1;
if ($contador == 75){ break;}
//Extract and show the “href” attribute.
//echo $link->nodeValue;
$valor_base = “/noticias/”;
$valor_comparacao = $link->getAttribute(‘href’);
// echo $link->getAttribute(‘href’).”
“;
$titulo = $link->nodeValue;
//echo $link->nodeValue.”

“;
$tem = strpos ($valor_comparacao, $valor_base);
//echo $link->getAttribute(‘href’).”

“;
if ($tem === false || $titulo == ‘Ouvidoria’ || $titulo == ‘Doadores’ || $titulo == ‘Twitter’ || $titulo == ‘Facebook’ || $titulo == ‘Youtube’ || $titulo == ‘Início’ || $titulo == ‘Institucional’ || $titulo == ‘Atividades’ || $titulo == ‘Modalidade de Policiamento’ || $titulo == ‘Banda de Música’ || $titulo == ‘Coral’ || $titulo == ‘Insrições’ || $titulo == ‘História’ || $titulo == ‘Patrono’ || $titulo == ‘Museu’ || $titulo == ‘Ex-Comandantes’ || $titulo == ‘Galeria de Personagens’ || $titulo == ‘Valores’ || $titulo == ‘Brasão e Logomarca’ || $titulo == ‘Missão, Visão e Valores’ || $titulo == ‘Insígnias e Divisas’ || $titulo == ‘Hinos e Canções’ || $titulo == ‘Condecorações e Medalhas’ || $titulo == ‘Comando Geral’ || $titulo == ‘Capelania’ || $titulo == ‘Policial’ || $titulo == ‘Pessoal’ || $titulo == ‘Profissional’ || $titulo == ‘Consultar Sistemas’ || $titulo == ‘Ensino’ || $titulo == ‘Artigos e opiniões’ || $titulo == ‘Produção Científica’ || $titulo == ‘Biblioteca’ || $titulo == ‘Portal de Ensino’ || $titulo == ‘Intranet’ || $titulo == ‘Seleção Interna’ || $titulo == ‘Saúde’ || $titulo == ‘1’ || $titulo == ‘2’ || $titulo == ‘3’ || $titulo == ‘4’ || $titulo == ‘5’ || $titulo == ‘6’ || $titulo == ‘7’ || $titulo == ‘8’ || $titulo == ‘Notícias Institucionais’ || $titulo == ‘Notícias Operacionais’) { }
else{
$url = “http://www.pm.sc.gov.br”.$link->getAttribute(‘href’);
if($url_cache == $url){}
else{
$url_cache = $url;
//echo $url.”

“;
$conteudo = file_get_contents($url);
$trecho = ‘src=”/fmanager’;
$novo_trecho = ‘src=”http://www.pm.sc.gov.br/fmanager’;
$conteudo = str_replace($trecho,$novo_trecho, $conteudo);

$trecho = ‘