예제 #1
0
            $item['atom_content'] = $item['content'];
        }
        if ($item['atom_content'] == "A") {
            $item['atom_content'] = $item['description'];
        }
        if (empty($item['updated']) && isset($item['dc']['date'])) {
            $item['updated'] = $item['dc']['date'];
        }
        if (empty($item['updated']) && isset($item['modified'])) {
            $item['updated'] = $item['modified'];
        }
        if (empty($item['updated']) && isset($item['pubdate'])) {
            $item['updated'] = $item['pubdate'];
        }
        if (empty($item['author'])) {
            $item['author'] = $flux_simple['nom'];
        }
        $item['timestamp'] = strtotime($item['updated']);
        if ($item['timestamp'] > time() - 7 * 24 * 3600) {
            echo ' - contenu récent : "' . $item['title'] . '"' . PHP_EOL;
            $contenu = $item['title'] . " " . $item['atom_content'];
            $item['etat'] = $planete_billet->avecContenuPertinent($contenu);
            $succes += $planete_billet->sauvegarder($flux_simple['id'], $item['id'], $item['title'], $item['link'], $item['timestamp'], $item['author'], $item['summary'], $item['atom_content'], $item['etat']);
            $billets++;
        }
    }
    echo $flux_simple['feed'] . " : fin !<br /><br/>\n\n";
}
$erreurs = $billets - $succes;
$duree = round(microtime(TRUE) - $startMicrotime, 2);
AFUP_Logs::log('Exploration de ' . count($flux) . ' flux -- ' . $erreurs . ' erreur(s) -- en ' . $duree . 's');