コード例 #1
0
ファイル: rss.inc.php プロジェクト: hostellerie/nexpro
/**
 * Create the Spam-X rss feed
 * 
 * @param items $ array of blacklisted sites
 *
 * $Id: rss.inc.php,v 1.7 2009/03/12 16:23:40 blaine.lang Exp $
 */
function Spamx_rss($items)
{
    global $_CONF;
    // Basic Data
    $about = $_CONF['site_url'] . '/spamx/index.php';
    $title = 'Spam-X Blacklist';
    $description = 'Personal Spamx Blacklist from site ' . $_CONF['site_name'];
    // Dublic Core Data
    $dc = array('dc:publisher' => $_CONF['site_name'], 'dc:creator' => $_CONF['site_name'], 'dc:date' => time());
    $rssfile = new RSSWriter($about, $title, $description, $dc);
    // Add items
    foreach ($items as $item) {
        $about = $_CONF['site_url'] . '/spamx/index.php';
        $title = $item;
        $description = $item;
        $dc = array('dc:subject' => 'Personal Blacklist', 'dc:author' => $_CONF['site_name']);
        $rssfile->addItem($about, $title, $dc);
    }
    // Now write the file
    $buff = $rssfile->serialize();
    $rdfpath = dirname($_CONF['rdf_file']);
    $rdffile = $rdfpath . '/spamx.rdf';
    $fp = fopen($rdffile, "w");
    fputs($fp, $buff);
    fclose($fp);
}
コード例 #2
0
ファイル: functions.php プロジェクト: BackupTheBerlios/erona
function makeRSS($p, $user)
{
    getFeeds("meine");
    $items = getItems(TIMESPAN_QUARTAL, TRUE, TRUE, 15);
    $rss = new RSSWriter("http://" . ERONA_URL . "myfeeds.php?p={$p}", $user['title'], $user['descr']);
    $rss->useModule("dc", "http://purl.org/dc/elements/1.1/");
    for ($i = 0; $i < count($items) - 1; $i++) {
        #echo $i;
        $rss->addItem($items[$i]['iurl'], $items[$i]['ititle'], array("description" => $items[$i]['idescr'], "dc:date" => iso8601_date($items[$i]['idate'])));
    }
    $rss->serialize();
}