本文整理匯總了PHP中FeedCreator::getRss2String方法的典型用法代碼示例。如果您正苦於以下問題:PHP FeedCreator::getRss2String方法的具體用法?PHP FeedCreator::getRss2String怎麽用?PHP FeedCreator::getRss2String使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FeedCreator
的用法示例。
在下文中一共展示了FeedCreator::getRss2String方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRss2String
function getRss2String($content, $pattern)
{
$Feed = new FeedCreator();
$Feed->setBase($pattern->baseurl, $pattern->feed_title, $pattern->baseurl);
$matchies = getMatchies($pattern->pattern, $content);
foreach ($matchies as $m) {
$id = $pattern->baseurl . time();
$title = itemReplace($pattern->item_title, $m);
$link = itemReplace($pattern->item_link, $m);
$summary = itemReplace($pattern->item_content, $m);
$Feed->addEntry($id, $title, $link, $summary);
}
$rss2 = $Feed->getRss2String();
unset($Feed);
return $rss2;
}
示例2: FeedCreator
<?php
require "functions.php";
$_POST = file_get_contents("php://input");
$posts = json_decode($_POST);
$Atom = new FeedCreator();
$Atom->setBase($posts->basurl, $posts->feed_title, $posts->baseurl);
$matchies = getMatchies($posts->pattern, $posts->html);
foreach ($matchies as $m) {
$id = $posts->baseurl . time();
$title = itemReplace($posts->item_title, $m);
$link = itemReplace($posts->item_link, $m);
$summary = itemReplace($posts->item_content, $m);
$Atom->addEntry($id, $title, $link, $summary);
}
echo $Atom->getRss2String();