예제 #1
0
파일: newz.php 프로젝트: pudney/hellaphone
 public function find($params = array())
 {
     require ROOT_DIR . DS . 'vendors' . DS . 'rss_php.php';
     $uri = 'http://v3.newzbin.com/search/query/?fpn=p&searchaction=Go&feed=rss';
     $params['area'] = !isset($params['area']) ? '-1' : $params['area'];
     $params['areadone'] = $params['area'];
     $params['category'] = str_ireplace('c.', '', $params['area']);
     foreach ($params as $key => $val) {
         if (!empty($val)) {
             $uri_params[] = "{$key}=" . urlencode($val);
         }
     }
     if (!empty($uri_params)) {
         $uri .= "&" . implode('&', $uri_params);
     }
     #die($uri);
     try {
         $rss_php = new rss_php();
         $rss_php->load($uri);
         return $rss_php->getItems();
     } catch (Exception $e) {
         echo $e;
     }
     return false;
 }
예제 #2
0
function process_request($config)
{
    # GOT THE FEEDS, PROCESS AND OUTPUT
    require_once 'rss_php.php';
    $rss = new rss_php();
    # SET DEFAULT ITEM COUNT, IN CASE ONE NOT SPECIFIED
    $count = $config["items"][0];
    if (@(!$count)) {
        $count = 1;
    }
    $feeds = $config["feeds"];
    for ($i = 0; $i < count($feeds); $i++) {
        $url = $feeds[$i];
        $rss->load($url);
        $items = $rss->getItems();
        echo "Items From {$url} \n";
        echo "===========";
        for ($j = 0; $j < strlen($url); $j++) {
            echo "=";
        }
        echo "\n\n";
        if (!$items) {
            echo "FAILED TO LOAD ANY ITEMS\n\n";
        } else {
            for ($k = 0; $k < $count; $k++) {
                if ($items[$k]) {
                    echo " * " . $items[$k]["title"] . "\n";
                }
            }
            echo "\n\n";
        }
    }
}
예제 #3
0
 public function export1($array)
 {
     $RSS_PHP = new rss_php();
     $RSS_PHP->loadArray($array);
     #the second param is an optional root node name
     return $RSS_PHP->getXML();
 }
예제 #4
0
 /**
  * loads the rss for the home page
  *
  */
 function getRss()
 {
     $RSS_PHP = new rss_php();
     try {
         $feed = $RSS_PHP->load('http://blog.metadataregistry.org/feed/');
         if ($feed) {
             $this->rssItems = $RSS_PHP->getItems();
         }
     } catch (Exception $e) {
     }
 }
예제 #5
0
//error_reporting(E_ALL);
require_once 'statusboard/db_connect.php';
require_once 'statusboard/rss_php.php';
// **********************************
// *     Code by Matt Satorius      *
// *        www.sators.com          *
// **********************************
// Get All the Feeds
$data = mysql_query("SELECT value1 AS feedicon, value2 AS feedurl FROM statusboard WHERE type = 'rssfeed' ORDER BY indexnumber ASC") or die(mysql_error());
while ($temp = mysql_fetch_array($data)) {
    $_rssfeed[] = $temp;
}
// What Feed was last displayed
$data = mysql_query("SELECT value1 AS lastdisplayedfeed FROM statusboard WHERE type = 'lastfeed'") or die(mysql_error());
while ($temp = mysql_fetch_array($data)) {
    $lastfeed = $temp["lastdisplayedfeed"];
}
// If it was the last feed in the list, show the first one, otherwise, the next feed and update the database with what feed we're showing
if (count($_rssfeed) - 1 == $lastfeed) {
    $newfeed = $_rssfeed[0];
    mysql_query("UPDATE statusboard SET value1 = 0 WHERE type = 'lastfeed'");
} else {
    $newfeednumber = $lastfeed + 1;
    $newfeed = $_rssfeed[$newfeednumber];
    mysql_query("UPDATE statusboard SET value1 = " . $newfeednumber . " WHERE type = 'lastfeed'");
}
// Using RSS_PHP to convert the RSS feed to JSON, but only retrieving the Items, not the full RSS list.
$rss = new rss_php();
$rss->load($newfeed["feedurl"]);
$newfeed["rss"] = $rss->getItems();
echo json_encode($newfeed);
function get_rss_node()
{
    $rss_node = "";
    $latest_posts = "";
    global $skyscraper_options;
    if (!empty($skyscraper_options["accept_read_rss"])) {
        if ($skyscraper_options["accept_read_rss"] != 1) {
            return $rss_node;
        }
    } else {
        return $rss_node;
    }
    $version = phpversion();
    if (substr($version, 0, 1) == 5 && isset($skyscraper_options["rss_feed"]) && $skyscraper_options["rss_feed"] != "http://") {
        include "rss_php.php";
        $rss = new rss_php();
        $rss->load($skyscraper_options["rss_feed"]);
        $items = $rss->getItems();
        if (!empty($skyscraper_options["rss_feed"])) {
            if (count($items) > 0) {
                $cant = 0;
                foreach ($items as $item) {
                    if ($cant <= $skyscraper_options["num_rss"]) {
                        $title = "";
                        if (isset($item["title"])) {
                            $title = addslashes($item["title"]);
                        }
                        $description = "";
                        if (isset($item["description"])) {
                            $description = addslashes($item["description"]);
                        }
                        $guid = "";
                        if (isset($item["link"])) {
                            $guid = addslashes($item["link"]);
                        }
                        $pubDate = "";
                        if (isset($item["pubDate"])) {
                            $pubDate = ago(strtotime($item["pubDate"]));
                        }
                        $latest_posts .= "['" . $title . "','','" . $description . "','" . $guid . "','" . $pubDate . "'],";
                    } else {
                        break;
                    }
                    $cant++;
                }
                $latest_posts = trim($latest_posts, ",");
            }
        }
    }
    if ($latest_posts != "") {
        $rss_node = "var LatestBlogPostContent = [\n\n\t\t\t\t\t\t\t\t\t\t" . $latest_posts . "\n\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\toPlugin.CreateNode('New_Id_5','Posts','',LatestBlogPostContent,'Notice',220,460);";
    }
    return $rss_node;
}
예제 #7
0
파일: rss.php 프로젝트: a2call/commsy
        <link>' . $link . '</link>
        <pubDate>' . encode(AS_RSS, $date) . '</pubDate>' . LF;
         if (!empty($author)) {
             $rss_item .= '           <author>' . encode(AS_RSS, trim($author)) . '</author>' . LF;
         }
         $rss_item .= '           <guid isPermaLink="false">' . $row['item_id'] . '</guid>' . LF;
         $rss_item .= '         </item>';
         $counter++;
         unset($title);
         unset($description);
         unset($link);
         unset($date);
         unset($author);
         // check rss
         include_once 'classes/external_classes/rss_php.php';
         $rss_parser = new rss_php();
         $rss_parser->suppressErrors();
         $rss_parser->loadRSS($rss . $rss_item . $rss_end);
         if ($rss_parser->isRSSOkay()) {
             $rss .= $rss_item;
         }
         unset($rss_item);
     }
 }
 $rss .= $rss_end;
 // debugging
 #pr($rss);
 #$db_connector = $environment->getDBConnector();
 #$sql_query_array = $db_connector->getQueryArray();
 #pr($sql_query_array);
 #exit();
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 * ************************************************************************* */
/* this file to be run witch CRON. generate last blog entery list on main page */
setlocale(LC_TIME, 'pl_PL.UTF-8');
global $lang, $rootpath, $config;
if (!isset($rootpath)) {
    $rootpath = __DIR__ . '/../../../';
}
//include template handling
require_once __DIR__ . '/../../../' . 'lib/common.inc.php';
require_once __DIR__ . '/../../../' . 'lib/cache_icon.inc.php';
require_once __DIR__ . '/../../../' . 'lib/rss_php.php';
$rss = new rss_php();
$rss->load($config['blogMostRecentRecordsUrl']);
$items = $rss->getItems();
$html = '<ul style="font-size: 11px;">';
$n = 0;
foreach ($items as $index => $item) {
    $pubDate = $item['pubDate'];
    $pubDate = strftime("%d-%m-%Y", strtotime($pubDate));
    $html .= '<li class="newcache_list_multi" style="margin-bottom:8px;"><img src="/tpl/stdstyle/images/free_icons/page.png" class="icon16" alt="news" title="news" /> ' . $pubDate . ' <a class=links href="' . $item['link'] . '" title="' . $item['title'] . '"><strong>' . $item['title'] . '</strong></a></li>';
    $n = $n + 1;
    if ($n == 5) {
        break;
    }
}
$html .= "</ul>";
$n_file = fopen($dynstylepath . "start_newblogs.inc.php", 'w');
예제 #9
0
파일: run.php 프로젝트: jasanders/os-aios
        $twitter_enabled = true;
    } else {
        $_msg = "PHP cURL is not enabled, so no tweets are send!";
        $objNZBLog->writeLine($_msg);
        if ($run_mode) {
            $run_mode_result = $_msg . "<br />";
        }
    }
}
# Instantiate download list object and retreive download list as an array
$objDownload = new nzbg_conf("download");
$arrDownloadList = $objDownload->get_xml_as_array();
# Instantiate queue list object
$objQueue = new nzbg_conf("queue");
# Instantiate a rss object to retreive tvnzb feed
$obj_tvnzb = new rss_php();
$obj_tvnzb->load($appConfig->tvnzbfeed);
# There are no problems loading the RSS
if ($obj_tvnzb->errorcode == 0) {
    # Load the tvnzb feed into an array
    $arrTVNzbs = $obj_tvnzb->getItems(true);
    # Well, let's loop tvnzb
    foreach ($arrTVNzbs as $current_nzb) {
        $current_key = 0;
        # We need to compare it against our downloadlist
        foreach ($arrDownloadList as $downloadentry) {
            # Type needs to be tvnzb
            if ($downloadentry['type'] == "tvnzb") {
                # Fetch title from feed and get string to compare, all to be lowercase
                $rss_title = strtolower($current_nzb['title']['value']);
                $find_string = strtolower($downloadentry['findstring']);