[LichessBridge] code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
01e0f2f77a
commit
98ebed9bc0
1 changed files with 3 additions and 2 deletions
|
@ -4,12 +4,13 @@ class LichessBridge extends HttpCachingBridgeAbstract
|
||||||
{
|
{
|
||||||
public $maintainer = 'AmauryCarrade';
|
public $maintainer = 'AmauryCarrade';
|
||||||
public $name = 'Lichess Blog';
|
public $name = 'Lichess Blog';
|
||||||
public $uri = 'http://lichess.org/blog';
|
public $uri = 'http://fr.lichess.org/blog';
|
||||||
public $description = 'Returns the 5 newest posts from the Lichess blog (full text)';
|
public $description = 'Returns the 5 newest posts from the Lichess blog (full text)';
|
||||||
|
|
||||||
public function collectData()
|
public function collectData()
|
||||||
{
|
{
|
||||||
$xml_feed = $this->getSimpleHTMLDOM('http://fr.lichess.org/blog.atom') or $this->returnServerError('Could not retrieve Lichess blog feed.');
|
$xml_feed = $this->getSimpleHTMLDOM($this->uri.'.atom')
|
||||||
|
or $this->returnServerError('Could not retrieve Lichess blog feed.');
|
||||||
|
|
||||||
$posts_loaded = 0;
|
$posts_loaded = 0;
|
||||||
foreach($xml_feed->find('entry') as $entry)
|
foreach($xml_feed->find('entry') as $entry)
|
||||||
|
|
Loading…
Reference in a new issue