本文整理汇总了PHP中Feed::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::__construct方法的具体用法?PHP Feed::__construct怎么用?PHP Feed::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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");
}
示例2: __construct
/**
* constructor
*
* @param string $starsFile File to store starred data
* @param Feed_Conf $kfc Object corresponding to feed reader config
*/
public function __construct($starFile, $starItemFile, $kfc)
{
parent::__construct($starFile, '', $kfc);
$this->starItemFile = $starItemFile;
if (is_file($this->starItemFile)) {
include_once $this->starItemFile;
}
}
示例3: __construct
/**
* @constructor
*/
public function __construct($config)
{
$config['url'] = sprintf('https://github.com/%s.atom', $config['username']);
$config['link'] = 'https://github.com/' . $config['username'];
$config['contenttype'] = 'application/atom+xml';
parent::__construct($config);
$this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a> ({{{date}}})</li>' . PHP_EOL);
}
示例4: __construct
/**
* __construct function.
* Set the required channel properties.
* @access public
* @param mixed $channelTitle
* @param mixed $channelLink
* @param mixed $channelDescription
* @return void
*/
public function __construct($channelTitle = '', $channelLink = '', $channelDescription = '')
{
parent::__construct();
// Set the required channel properties
$this->setProperty('title', $channelTitle);
$this->setProperty('link', $channelLink);
$this->setProperty('description', $channelDescription);
// Set the last build date to the current date and time
$this->setProperty('lastBuildDate', date(DateTime::RSS));
}
示例5: __construct
public function __construct($config)
{
$config['list'] = isset($config['list']) ? $config['list'] : 'uploads';
$config['url'] = 'http://gdata.youtube.com/feeds/api/users/' . $config['username'] . '/' . $config['list'] . '?v=2&orderby=published&max-results=' . $config['total'];
$config['link'] = 'http://youtube.com/user/' . $config['username'];
$config['contenttype'] = 'application/atom+xml';
parent::__construct($config);
$this->setItemTemplate('<li>
<a href="{{{link}}}"><img src="{{{media_thumbnail_url}}}" alt="" class="item-media-thumbnail" height="75"/>
{{{title}}}</a> ({{{date}}})
</li>' . "\n");
}
示例6: __construct
public function __construct($config)
{
$config['list'] = isset($config['list']) ? $config['list'] : 'videos';
$config['url'] = sprintf('http://vimeo.com/%s/%s/rss', $config['username'], $config['list']);
$config['link'] = 'http://www.vimeo.com/' . $config['username'] . '/';
$config['contenttype'] = 'application/rss+xml';
parent::__construct($config);
$this->setItemTemplate('<li>
<a href="{{{link}}}"><img src="{{{media_thumbnail_url}}}" alt="" class="item-media-thumbnail" height="75"/>
{{{title}}}</a> ({{{date}}})
</li>' . "\n");
}
示例7: __construct
/**
* __construct function.
* Set the required element properties.
* @access public
* @param mixed $channelTitle
* @param mixed $channelId
* @param mixed $channelDescription
* @return void
*/
public function __construct($channelTitle = '', $channelId = '')
{
parent::__construct();
// Set the required channel elements
$this->setProperty('title', $channelTitle);
/**
* The channel ID "Identifies the feed using a universally unique and permanent URI"
* See: http://www.atomenabled.org/developers/syndication/#requiredFeedElements
*/
$this->setProperty('id', $channelId);
// Set the last build date to the current date and time
$this->setProperty('updated', date(DateTime::ATOM));
}
示例8: __construct
public function __construct($config)
{
$config['link'] = 'http://delicious.com/' . $config['username'] . '/';
$config['url'] = sprintf('http://feeds.delicious.com/v2/rss/%s?count=%s', $config['username'], $config['total']);
parent::__construct($config);
$this->setItemTemplate('<li>
<a href="{{{link}}}">{{{title}}}</a>
({{{date}}})
{{#category}}
<em><a href="{{{service_link}}}{{{category}}}">{{{category}}}</a></em>
{{/category}}
</li>' . "\n");
}
示例9: DOMDocument
function __construct($file, $recordLabel)
{
parent::__construct();
/* $file = file_get_contents($contentFile['products']);
$htmlDom = new DOMDocument();
$htmlDom->loadXML($file);
$this->_file_handler = $htmlDom->getElementsByTagName($contentFile['record']); */
$file = file($file);
$file = implode("", $file);
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $file, $this->_file_handler, $this->_items_iterator);
xml_parser_free($parser);
if (isset($recordLabel)) {
$this->_items_iterator = $this->_items_iterator[$recordLabel];
} else {
throw new Exception("Error: Not defined delimiter");
}
$this->_items_iterator = new ArrayIterator(array_chunk($this->_items_iterator, 2));
}
示例10: __construct
public function __construct($config)
{
$config['link'] = 'http://delicious.com/' . $config['username'] . '/';
$tags = null;
if (isset($config['tags']) && is_string($config['tags'])) {
$tags = explode(',', $config['tags']);
foreach ($tags as $i => $tag) {
$tags[$i] = urlencode(trim($tag));
}
$tags = '/' . implode('+', $tags);
}
$config['url'] = sprintf('http://feeds.delicious.com/v2/rss/%s%s?count=%s', $config['username'], $tags, $config['total']);
parent::__construct($config);
$this->setItemTemplate('<li>
<a href="{{{link}}}">{{{title}}}</a>
({{{date}}})
{{#category}}
<em><a href="{{{service_link}}}{{{category}}}">{{{category}}}</a></em>
{{/category}}
</li>' . "\n");
}
示例11: __construct
public function __construct($config)
{
$username = '';
$this->hasUsername = null;
if (isset($config['username'])) {
$username = $config['username'] . '/';
$this->hasUsername = $config['username'];
}
$tag = '';
$this->hasTag = null;
if (isset($config['tag'])) {
$tag = 'tag/' . $config['tag'] . '/';
$this->hasTag = $config['tag'];
}
$config['contenttype'] = 'application/rss+xml';
$config['link'] = 'http://identi.ca/' . $username . $tag;
$config['url'] = $config['link'] . 'rss';
parent::__construct($config);
$this->setItemTemplate('<li>' . (!$this->hasUsername ? '<strong><a href="{{{user_link}}}">@{{{user_name}}}</a></strong>: ' : '') . '{{{status}}}
(<a href="{{{link}}}">{{{date}}}</a>)
</li>' . PHP_EOL);
}
示例12: __construct
/**
* {@inheritdoc}
*/
public function __construct($enabledCDATAEncoding = true)
{
parent::__construct(Feed::RSS2, $enabledCDATAEncoding);
}
示例13: __construct
public function __construct($config)
{
$config['contenttype'] = 'application/rss+xml';
parent::__construct($config);
}
示例14: __construct
/**
* @desc Builds a new ATOM object
* @param string $module_id its module_id
* @param string $feed_name the feeds name / type. default is Feed::DEFAULT_FEED_NAME
* @param int $id_cat the feed category id
*/
public function __construct($module_id, $feed_name = Feed::DEFAULT_FEED_NAME, $id_cat = 0)
{
parent::__construct($module_id, $feed_name, $id_cat);
$this->tpl = new FileTemplate(self::DEFAULT_ATOM_TEMPLATE);
}
示例15:
/**
* {@inheritdoc}
*/
function __construct()
{
parent::__construct(Feed::RSS2);
}