<?php
/**************************************************************
*
* DataFeedFile.com (DFF) Framework API
* Copyright (c) 2008 DataFeedFile.com
*
* DFF Framework API uses CreativeCommons.org by-sa license.
* This license lets others remix, tweak, and build upon your work even for commercial reasons,
* as long as they CREDIT DataFeedFile.com and license their new creations under the identical terms.
* This license is often compared to open source software licenses.
* All new works based on yours will carry the same license, so any derivatives will also allow commercial use.
* Please read our license.txt file for more detail.
*
**************************************************************//* input params_array:
* url = string - RSS base URL?
* title = string
* description = string
* language = string (ex:en-us)
* copyright = string (ex: DataFeedFile 2008)
* creator = string
* subject = string
* image_url = string, optional
*/
require_once $DFF_config['dir_include'].'DFF_rss.class.php';
function DFF_create_rss($params_array, $values, $limit=100){
$rss_feed = new RSS_Feed;
$rss_feed->set_channel($params_array['url'],$params_array['title'],$params_array['description'],$params_array['language'],$params_array['copyright'],$params_array['creator'],$params_array['subject']);
$rss_feed->set_image($params_array['image_url']);
if($values['stats']['type']=='DSE') {
$limited = array_splice($values['limited'], 0, $limit);
foreach($limited as $deal) {
$rss_feed->add_item($deal['target_url'],$deal['headline'],$deal['description']);
}
$output = $rss_feed->output();
} else {
$output = 'Unknown input value type: '.$values['stats']['type'];
}
header('Content-type: text/xml; charset="utf-8"',true);
return $output;
}
?>