Exemple #1
0
<?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;
Exemple #2
0
<?
/*********************************************
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);
Exemple #3
0
<?php

/*****************************************************
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");
Exemple #4
0
<?php

/*************************************************
Esse arquivo recebe o site que o usu�rio
digita diretamente no site.

Sistema desenvolvido por Noedir C. Filho
http://www.constantweb.com.br  -  2010
**************************************************/
session_start();
include_once "classes/conecta.class.php";
$via = new mysqlConn();
if ($_POST['manda'] == "sim") {
    $sql = "SELECT * FROM tbl_site WHERE sit_url = '{$_POST['url']}'";
    $nbus = $via->totalRegistros($sql);
    if ($nbus < 1) {
        $via->setAcao("insert");
        $via->setTabela("tbl_acre");
        $via->setCampos("acr_url");
        $via->setValores("'" . $_POST['url'] . "'");
        $via->executa();
        echo '<script type="text/javascript">
		alert("Dados cadastrados com sucesso.\\r\\n\\r\\nSerão indexados em até 24 horas.");
		location.href="index.php";
	</script>';
    } else {
        echo '<script type="text/javascript">
	alert("Esse site já está cadastrado no sistema.\\r\\n\\r\\nExperimente inserir um diretório.");
	location.href="acrescenta.php";
        </script>';
    }
Exemple #5
0
<?php
session_start();

include_once("classes/conecta.class.php");
$via = new mysqlConn();

if($_GET['bus'] == "sim" and $_GET['qy'] <> ""){

    if($_GET['tipo'] == "toda"){
        $idioma = "";
    }else{
        $idioma = "AND sit_idioma LIKE '%".$_GET['tipo']."%'";
    }

    $sql = "SELECT * FROM tbl_site WHERE sit_url LIKE '%".$_GET['qy']."%' OR sit_metakey LIKE '%".$_GET['qy']."%' OR sit_metades LIKE '%".$_GET['qy']."%' $idioma ORDER BY sit_relevancia DESC LIMIT 30";
    $qr = $via->consulta($sql);

    $nbus = $via->totalRegistros($sql);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include("meta.php"); ?>
<title>Via Busca</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000;