<? /********************************************* Esse arquivo atualiza as informa��es dos sites que j� est�o cadastrados. Isso � necess�rio para que os dados n�o fiquem obsoletos. Essa verifica��o � feita uma vez por m�s. Sistema desenvolvido por Noedir C. Filho http://www.constantweb.com.br - 2010 *********************************************/ include_once("classes/conecta.class.php"); $via = new mysqlConn(); $sql = "SELECT * FROM tbl_site"; $qr = $via->consulta($sql); while($sit = $qr->fetch(PDO::FETCH_ASSOC)){ $head = get_headers($sit['sit_url']); $head = substr_count($head[0],"200"); if($head >= 1){ $pega = file_get_contents($sit['sit_url']); $tti = $pega; $pega = ereg_replace('<script.*</script>', '', $pega); $pega = ereg_replace('<object.*</object>', '', $pega);
<?php /************************************************* Esse arquivo pega os sites cadastrados e faz a varredura para acrescentar na tabela sites. Isso � feito diariamente �s 3 da manh�. Sistema desenvolvido por Noedir C. Filho http://www.constantweb.com.br - 2010 **************************************************/ include_once "classes/conecta.class.php"; $via = new mysqlConn(); //Pega as informa��es da tabela ACRE $sql = "SELECT * FROM tbl_acre WHERE acr_indexado = 'n'"; $qr = $via->consulta($sql); set_time_limit(0); while ($sit = $qr->fetch(PDO::FETCH_ASSOC)) { $jacds = $via->totalRegistros("SELECT * FROM tbl_site WHERE sit_url = '" . $sit['acr_url'] . "'"); if ($jacds < 1) { //Verifica se possui o http:// ou https:// $conta = substr_count($sit['acr_url'], "http://"); $conta += substr_count($sit['acr_url'], "https://"); if ($conta >= 1) { //Verifica se o site existe realmente $head = get_headers($sit['acr_url']); $header = substr_count($head[0], "200"); if ($header >= 1) { //Pega o conte�do todo do site. $pega = file_get_contents($sit['acr_url']); // Armazena o conte�do em outra vari�vel $tti = $pega;
/***************************************************** A finalidade desse arquivo � pegar os links dos sites e acrescentar para indexar outros sites na lista de busca. Esse recurso � similar ao Google, pois n�o � necess�rio que se cadastre outros site, o sistema j� faz isso automaticamente. � executado uma vez por semana. Sistema desenvolvido por Noedir C. Filho http://www.constantweb.com.br - 2010 ******************************************************/ include_once "classes/conecta.class.php"; $via = new mysqlConn(); $sql = "SELECT * FROM tbl_acre WHERE acr_indexado = 's'"; $qr = $via->consulta($sql); $dom = new DOMDocument(); while ($sit = $qr->fetch(PDO::FETCH_ASSOC)) { @$dom->loadHTML(file_get_contents($sit['acr_url'])); $tags = $dom->getElementsByTagName("a"); foreach ($tags as $tag) { $link = $tag->getAttribute('href'); if ($link != "") { echo $link . "<br>"; } $ver = substr_count($link, "http://"); $ver += substr_count($link, "https://"); if ($ver >= 1) { $head = get_headers($link); $header = substr_count($head[0], "200"); if ($header >= 1) {