本文整理汇总了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;
}
示例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";