コード例 #1
0
ファイル: cron.php プロジェクト: KasaiDot/Fansubs.cat
<?php

include_once dirname(__FILE__) . '/app/classes/Planet.class.php';
include_once dirname(__FILE__) . '/app/lib/Cache.php';
include_once dirname(__FILE__) . '/app/lib/lib.http.php';
//Load configuration
if (is_file(dirname(__FILE__) . '/custom/config.yml')) {
    $conf = Spyc::YAMLLoad(dirname(__FILE__) . '/custom/config.yml');
    $PlanetConfig = new PlanetConfig($conf);
} else {
    die('Config file (custom/config.yml) is missing.');
}
//Instantiate app
$Planet = new Planet($PlanetConfig);
//Load OPML
if (0 < $Planet->loadOpml(dirname(__FILE__) . '/custom/people.opml')) {
    $Planet->download(1.0);
}
var_dump($Planet->errors);
コード例 #2
0
<?php

/**
 * Load one particular feed
 */
error_reporting(0);
include_once dirname(__FILE__) . '/app/classes/Planet.class.php';
function unhtmlspecialchars($string)
{
    $string = str_replace('&amp;', '&', $string);
    $string = str_replace('&#039;', '\'', $string);
    $string = str_replace('&quot;', '\\"', $string);
    $string = str_replace('&lt;', '<', $string);
    $string = str_replace('&gt;', '>', $string);
    return $string;
}
//Build config object
//Use OPML title if no title defined in the config file
$PlanetConfig = new PlanetConfig(array());
//Instantiate app
$Planet = new Planet($PlanetConfig);
$Planet->addPerson(new PlanetPerson('', unhtmlspecialchars($_GET['url']), ''));
//Load feeds
$Planet->download(1);
header("Content-type: image/png");
readfile(dirname(__FILE__) . "/custom/img/feed.png");
die;