Commit e96eb867 authored by Feu's avatar Feu

galaxy hourly

parent 257010e0
......@@ -30,6 +30,8 @@ define("GALAXY_SCORE_PARRAINAGE",15);
define("GALAXY_SCORE_1PTJOURSASSO",75);
define("GALAXY_MINSCORE",10);
setlocale(LC_NUMERIC,"en_US");
class galaxy
{
var $db;
......
......@@ -4,40 +4,27 @@
* hourly
*/
$topdir="../";
$_SERVER['SCRIPT_FILENAME']="/var/www/ae/www/ae2/phpcron";
require_once($topdir. "include/site.inc.php");
$site = new site ();
// Tâche 2 [galaxy] : màj, et cycles
require_once($topdir. "include/galaxy.inc.php");
$galaxy = new galaxy($site->db,$site->dbrw);
$galaxy->update();
for($i=0;$i<45;$i++) // Environs 1100 cycles/jours
$galaxy->cycle();
print_r($galaxy);
$galaxy->mini_render($topdir."var/mini_galaxy.png");
print_r($galaxy);
// Tâche 1 [planet]
define('MAGPIE_CACHE_DIR', '/var/www/ae/www/var/cache/planet/');
define('MAGPIE_CACHE_ON', true);
define('MAGPIE_CACHE_AGE', 50*60); //50minutes pour etre certain d'avoir un truc à jour :)
define('MAGPIE_OUTPUT_ENCODING', "UTF-8");
define('MAX_NUM',20);
define('MAX_SUM_LENGHT',200);
$_SERVER['SCRIPT_FILENAME']="/var/www/ae/www/ae2/phpcron";
require_once($topdir. "include/site.inc.php");
require_once($topdir. "include/lib/magpierss/rss_fetch.inc.php");
$site = new site ();
// Tâche 1 [planet] : mettre à jour le cache
$req = new requete($site->db,"SELECT `url` FROM `planet_flux` WHERE `modere`='1'");
while ( list($url) = $req->get_row() )
$rs=fetch_rss($url);
// Tâche 1 [planet] : nettoyage du cache
$cache = opendir(MAGPIE_CACHE_DIR);
while ($file = readdir($cache))
......@@ -46,5 +33,19 @@ while ($file = readdir($cache))
closedir($cache);
// Tâche 2 [galaxy] : màj, et cycles
require_once($topdir. "include/galaxy.inc.php");
$galaxy = new galaxy($site->db,$site->dbrw);
$galaxy->update();
for($i=0;$i<45;$i++) // Environs 1100 cycles/jours
$galaxy->cycle();
$galaxy->mini_render($topdir."var/mini_galaxy.png");
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment