* @license PHP License * @package WB * @subpackage datasource */ WBClass::load('WBDatasource_Sitemap' ); /** * Datasource Sitemap Blog * * Add recent blog posts to sitemap * * @todo configure priority and limit * @version 0.1.0 * @package WB * @subpackage datasource */ class WBDatasource_Sitemap_Blog extends WBDatasource_Sitemap { /** * @var WBBlog_Tool */ private $blog; /** * Find all the URLs * * Get recent blog posts */ public function find() { $this->blog = WBClass::create('WBBlog_Tool'); $options = array( 'limit' => 500 ); $priority = 1.1; $list = $this->blog->getList($options); foreach ($list as $i => $l) { // decrease priority if (0 == ($i % 100)) { $priority -= 0.1; $this->setPriority($priority); } $this->blog->loadArticleByData($l); $this->setPath($this->blog->getArticlePath()); $this->notify(); } } }