Exemplo n.º 1
0
     $struct = new OutlineFromXML($_REQUEST['data'], array('rootel' => 'rdf:RDF', 'itemel' => 'item', 'collapsels' => array('title', 'description')));
 }
 if (!$struct && stristr($_REQUEST['data'], '<feed')) {
     $struct = new OutlineFromXML($_REQUEST['data'], array('rootel' => 'feed', 'itemel' => 'entry', 'collapsels' => array('title', 'content', 'summary')));
 }
 if (is_a($struct->getField('channel'), 'Outline')) {
     $channel = $struct->getField('channel');
     foreach ($channel->getFields() as $name => $val) {
         $struct->addField($name, $val);
     }
     $struct->unsetField('channel');
 }
 //end if channel
 $tmp = $struct->getNode(0);
 if (!$tmp->getField('link')) {
     foreach ($struct->getNodes() as $id => $nodes) {
         foreach ($nodes->getNodes() as $node) {
             if ($node->getField('rel') == 'alternate') {
                 $struct->_subnodes[$id]->setField('link', $node->getField('href'));
                 break;
             }
             //end if
         }
         //end foreach nodes
     }
     //end foreach stuct
 }
 //end if ! link
 $blogtitle = $struct->getField('title');
 $bloglink = $struct->getField('link');
 if (is_a($bloglink, 'Outline')) {
Exemplo n.º 2
0
//end if p
require_once 'xn-app://xoxotools/std_rss_out.php';
require_once 'xn-app://xoxotools/OutlineClasses/OutlineFromXML.php';
$_REQUEST['usr'] = $item->title;
$_REQUEST['p'] = str_rot13($item->description);
$_REQUEST['tag'] = $_REQUEST['tag'] ? '?tag=' . $_REQUEST['tag'] : '';
$apiget = file_get_contents('https://' . $_REQUEST['usr'] . ':' . $_REQUEST['p'] . '@api.del.icio.us/v1/posts/all' . $_REQUEST['tag']);
$apiget = new OutlineFromXML($apiget);
$out = array();
$out['title'] = 'del.icio.us / ' . $apiget->getField('user');
$out['description'] = 'RSS feed of ALL posts.';
$out['link'] = 'http://del.icio.us/' . $apiget->getField('user');
$out['dc:creator'] = $apiget->getField('user');
$out['pubDate'] = strtotime($apiget->getField('update'));
$out['items'] = array();
foreach ($apiget->getNodes() as $item) {
    $outi = array();
    $outi['title'] = $item->getField('description');
    $outi['description'] = $item->getField('extended');
    $outi['link'] = $item->getField('href');
    $outi['guid'] = $item->getField('hash');
    $outi['dc:creator'] = $out['dc:creator'];
    $outi['comments'] = 'http://del.icio.us/url/' . $item->getField('hash');
    $outi['wfw:commentRss'] = 'http://del.icio.us/rss/url/' . $item->getField('hash');
    $outi['pubDate'] = strtotime($item->getField('time'));
    $outi['category'] = explode(' ', $item->getField('tag'));
    $out['items'][] = $outi;
}
//end foreach
header('Content-Type: application/xml;charset=utf-8');
echo std_rss_out($out);