当前位置: 首页>>代码示例>>PHP>>正文


PHP RSS::get_feed方法代码示例

本文整理汇总了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();
开发者ID:vmei,项目名称:MIT-Mobile-Web,代码行数:30,代码来源:detail.php

示例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.";
    }
}
开发者ID:vmei,项目名称:MIT-Mobile-Web,代码行数:30,代码来源:index.php

示例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();
开发者ID:vmei,项目名称:MIT-Mobile-Web,代码行数:31,代码来源:index.php


注:本文中的RSS::get_feed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。