本文整理汇总了PHP中RSS::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP RSS::__construct方法的具体用法?PHP RSS::__construct怎么用?PHP RSS::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSS
的用法示例。
在下文中一共展示了RSS::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($config)
{
$config['link'] = 'http://pinboard.in/u:' . $config['username'] . '/';
$config['url'] = sprintf('http://feeds.pinboard.in/rss/secret:%s/u:%s/', $config['secret'], $config['username']);
parent::__construct($config);
$this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a></li>' . "\n");
}
示例2: __construct
public function __construct($config)
{
$config['link'] = 'http://www.facebook.com/' . $config['username'] . '/';
$config['url'] = sprintf('http://www.facebook.com/feeds/status.php?id=%d&viewer=%d&key=%s&format=rss20', $config['id'], $config['id'], $config['key']);
parent::__construct($config);
$this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a> {{{date}}}</li>' . "\n");
}
示例3: __construct
public function __construct($config)
{
$config['link'] = 'http://www.instapaper.com/';
$config['url'] = sprintf('http://www.instapaper.com/archive/rss/%s/%s', $config['userid'], $config['token']);
parent::__construct($config);
$this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a></li>' . "\n");
}
示例4: __construct
public function __construct()
{
parent::__construct("https://i-share.carli.illinois.edu/newbooks/newbooks.cgi?library=WHEdb&list=all&day=7&op=and&text=&lang=English&submit=RSS");
$nitems = count($this->xml->channel->item);
for ($i = 0; $i < $nitems; ++$i) {
$tidy_desc = \str_replace(array('<B>', '</B>', '<description>', '</description>'), '', $this->xml->channel->item[$i]->description->asXML());
$matches = array();
if (\preg_match('@<img border="0" src="(.*)" vspace="3" border="0" align="right"/>@', $tidy_desc, $matches)) {
if (\util\Utility::isValidImage($matches[1])) {
$imgurl = $matches[1];
} else {
$imgurl = "";
}
$tidy_desc = str_replace($matches[0], '', $tidy_desc);
} else {
$imgurl = "";
}
$fieldstr = \explode('<BR/>', $tidy_desc);
$this->xml->channel->item[$i]->description = \implode("\n", $fieldstr);
$fields = array();
foreach ($fieldstr as $f) {
//separate field name and field value
$matches = array();
if (\preg_match("/^([-a-zA-Z_ ]*[a-zA-Z]{4}): /", $f, $matches)) {
$fname = \strtolower(str_replace(' ', '_', \trim($matches[1])));
$fvalue = \trim(str_replace($matches[0], '', $f));
$fields[$fname] = $fvalue;
$this->xml->channel->item[$i]->addChild($fname, $fvalue);
}
}
$cn_data = \cn\processor\Factory::make($fields)->data();
foreach ($cn_data as $name => $value) {
$name = \htmlspecialchars($name);
$value = \htmlspecialchars($value);
$this->xml->channel->item[$i]->addChild($name, $value);
}
unset($this->xml->channel->item[$i]->description[0]);
if (!\util\Utility::isValidImage($imgurl)) {
$imgurl = "";
}
$this->xml->channel->item[$i]->addChild('cover', $imgurl);
}
}
示例5:
function __construct()
{
parent::__construct();
}
示例6: __construct
public function __construct($config)
{
parent::__construct($config);
}