Пример #1
0
function feed2hatom($url)
{
    XN_Application::includeFile('alphacomponents', '/Alpha/Format/RSS.php');
    $feed = XNC_Alpha_Format_RSS::load($url);
    $outlinearray = array();
    $outlinearray[0]['rel'] = 'home';
    $outlinearray[0]['text'] = $feed->title;
    $outlinearray[0]['href'] = $feed->link;
    $outlinearray[0]['title'] = $feed->description;
    $outlinearray[0]['text#1'] = '[feed]';
    $outlinearray[0]['href#1'] = $_GET['url'];
    $count = 1;
    if (!$feed->items) {
        return $outlinearray;
    }
    foreach ($feed->items as $item) {
        $outlinearray[$count]['text'] = $item->title;
        $outlinearray[$count]['href'] = $item->link;
        if ($item->description) {
            $outlinearray[$count]['body'] = str_replace('</br>', '', str_replace('<br>', '<br />', $item->description));
            $outlinearray[$count]['body>>class'] = 'entry-content';
        }
        //end if description
        if ($item->pubDate) {
            $outlinearray[$count]['title'] = $item->pubDate * 1000000000;
            $outlinearray[$count]['published'] = date('c', $item->pubDate);
            $outlinearray[$count]['published>>class'] = 'published';
        }
        //end if pubDate
        if ($item->comments) {
            $outlinearray[$count]['href#1'] = $item->comments;
            $outlinearray[$count]['text#1'] = 'comments';
            $outlinearray[$count]['rel#1'] = 'comments';
        }
        //end if comments
        if ($item->author || $item->dc->creator) {
            $outlinearray[$count]['text#2'] = $item->author ? $item->author : $item->dc->creator;
            $outlinearray[$count]['rel#2'] = 'author';
            $outlinearray[$count]['class#2'] = 'author vcard fn';
        }
        //end if comments
        $outlinearray[$count]['rel'] = 'bookmark';
        $outlinearray[$count]['class'] = 'entry-title';
        $count++;
    }
    //end foreach feed->items
    return $outlinearray;
}
Пример #2
0
<?php

XN_Application::includeFile('xoxotools', '/OutlineClasses/Outline.php');
XN_Application::includeFile('xoxotools', '/OutlineClasses/OutlineFromXOXO.php');
XN_Application::includeFile('xoxotools', '/OutlineClasses/OutlineFromOPML.php');
XN_Application::includeFile('xoxotools', '/OutlineClasses/JSON.php');
$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
//Reading List
function process_reading_list($obj)
{
    foreach ($obj->getNodes() as $node) {
        if ($node->getField('href')) {
            echo '   <li><a href="' . $node->getField('href') . '" title="' . $node->getField('title') . '">' . $node->getField('text') . '</a>' . ($node->getField('href#1') ? ' <a href="' . $node->getField('href#1') . '" rel="alternate">[feed]</a>' : '') . '</li>' . "\n";
        }
        if ($node->getNumNodes()) {
            process_reading_list($node);
        }
    }
    //end foreach nodes
}
//end function
$readinglistdata = file_get_contents('http://www.awriterz.org/etcetc/boxtheweb/exportboxes.php?user=hash%3Afc6e6f4412f270b70b869cf7757122d4&format=xoxo&feedsonly=on');
if (stristr('<opml', $readinglistdata)) {
    $obj = new OutlineFromOPML($readinglistdata);
} else {
    $obj = new OutlineFromXOXO($readinglistdata);
}
$obj->toOPMLfields();
$obj->toXOXOfields();
echo '<h2>Reading List</h2>' . "\n";
echo '<ul>' . "\n";
Пример #3
0
<?php

/* License (BSD)
Copyright (c) 2004, Ryan Lee
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    * Neither the name of the ryanlee.org nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Modifications (c) 2006 Stephen Paul Weber */
XN_Application::includeFile('xoxotools', '/OutlineClasses/OutlineFromXML.php');
$xanga_username = "";
$xanga_password = "";
$xanga_comments = 0;
// 1 = allow comments on Xanga post, 0 = no comments
$xanga_premium = 0;
// 1 = accounts is Premium Xanga, 0 = normal (free)
$xanga_authors = 0;
// 1 = show wp author's name as profile data pref
$xanga_title = 1;
// 1 = use Xanga's title parameter; title will show
//     above all other parts of post
$xanga_protected = 0;
// 1 = post your WP password protected posts to Xanga
//     as a Xanga protected post
function xanga_fetch_login_key()