本文整理汇总了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();