本文整理汇总了PHP中RSS::get_feed方法的典型用法代码示例。如果您正苦于以下问题:PHP RSS::get_feed方法的具体用法?PHP RSS::get_feed怎么用?PHP RSS::get_feed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSS
的用法示例。
在下文中一共展示了RSS::get_feed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RSS
/**
* Copyright (c) 2009 West Virginia University
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
*/
// various copy includes
require_once "../../config.gen.inc.php";
require_once "data/data.inc.php";
// records stats
require_once "../page_builder/page_header.php";
// libs
require_once "../../lib/rss_services.php";
$News = new RSS();
$items = $News->get_feed($news_srcs[$_REQUEST['src']]['url']);
$title = stripslashes($_REQUEST['title']);
$text = explode("\n", $items[$title]['text']);
$link = $items[$title]['link'];
$read_more = $news_srcs[$_REQUEST['src']]['read_more'];
$section = $news_srcs[$_REQUEST['src']]['title'];
$paragraphs = array();
foreach ($text as $paragraph) {
if ($paragraph) {
$paragraphs[] = str_replace('Read more ...', '', $paragraph);
}
}
$long_date = str_replace(' 0:00:00', '', date("l, F j, Y G:i:s", $items[$title]['unixtime']));
require "templates/{$prefix}/detail.html";
$page->output();
示例2: RSS
<?php
/**
* Copyright (c) 2009 West Virginia University
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
*/
require_once "../../../lib/rss_services.php";
require_once "../data/data.inc.php";
$Emergency = new RSS();
$emergencies = $Emergency->get_feed($emergency_rss_feed);
if ($emergencies === False) {
echo 'Emergency information is currently not available';
} else {
foreach ($emergencies as $title => $emergency) {
$text = explode("\n", $emergency[$title]['text']);
$paragraphs = array();
foreach ($text as $paragraph) {
if ($paragraph) {
echo $paragraph;
}
}
}
// handle the case that an emergency RSS feed doesn't return data until emergency (like e2campus)
if ($paragraphs == False) {
echo "There is currently no emergency on campus.";
}
}
示例3: key
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
*/
// various copy includes
require_once "../../config.gen.inc.php";
require_once "data/data.inc.php";
// records stats
require_once "../page_builder/page_header.php";
// libs
require_once "../../lib/rss_services.php";
require_once "lib/textformat.lib.php";
if (array_key_exists($_REQUEST['news'], $news_srcs)) {
$rss_url = $news_srcs[$_REQUEST['news']]['url'];
$section = $news_srcs[$_REQUEST['news']]['title'];
$key = $_REQUEST['news'];
$shared = true;
} else {
$key = key($news_srcs);
$rss_url = $news_srcs[$key]['url'];
$section = $news_srcs[$key]['title'];
$shared = false;
}
$News = new RSS();
$items = $News->get_feed($rss_url);
if ($shared == true) {
require "templates/{$prefix}/shared.html";
} else {
require "templates/{$prefix}/index.html";
}
$page->output();