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


PHP RSS::get方法代码示例

本文整理汇总了PHP中RSS::get方法的典型用法代码示例。如果您正苦于以下问题:PHP RSS::get方法的具体用法?PHP RSS::get怎么用?PHP RSS::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSS的用法示例。


在下文中一共展示了RSS::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 function show()
 {
     $url = FoodleUtils::getUrl() . 'foodle/' . $this->foodle->identifier;
     $responses = $this->foodle->getResponses();
     $rssentries = array();
     foreach ($responses as $response) {
         #echo '<pre>'; print_r($response); echo '</pre>';
         $newrssentry = array('title' => $response->username, 'description' => 'Response: ' . self::encodeResponse($response->response['data']), 'pubDate' => $response->created);
         if (isset($entry['notes'])) {
             $newrssentry['description'] .= '<br /><strong>Comment from user: </strong><i>' . $response->notes . '</i>';
         }
         $newrssentry['description'] .= '<br />[ <a href="' . $url . '">go to foodle</a> ]';
         $rssentries[] = $newrssentry;
     }
     $rss = new RSS($this->foodle->name);
     #$rss->description = $this->foodle->description;
     $rsstext = $rss->get($rssentries);
     header('Content-Type: text/xml');
     echo $rsstext;
 }
开发者ID:r4mp,项目名称:Foodle,代码行数:20,代码来源:RSSFoodle.php

示例2: RSS

#!/usr/bin/php
<?php 
require 'rss.php';
require '/home/www/richtaur.com/chat/common/init.php';
$room_id = (int) $argv[1];
$url = $argv[2];
$rss = new RSS($url, $room_id);
$json = json_decode($rss->get());
if (!$json || !$json->guid) {
    exit;
}
$log .= "----------\n";
$log .= "Time: " . date('r') . "\n";
$threshold = time() - 300;
// 5 minutes ago
$time = strtotime($json->pubDate);
if ($time < $threshold) {
    $log .= "{$time} < {$threshold}, exiting ...\n";
    file_put_contents('/home/richter/tmp/chat.log', $log, FILE_APPEND);
    exit;
}
$log .= "going\n";
$tokens = explode(':', $json->description);
$name = $tokens[0];
$message = substr($json->description, strlen($name) + 2);
$message .= " (via http://twitter.com/{$name})";
/*
echo "going ahead\n";
echo "twitter time: $time\n";
echo "php time: " . time() . "\n";
开发者ID:richtaur,项目名称:chat,代码行数:30,代码来源:exec.php


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