mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 01:25:21 +02:00
Reformat codebase v4 (#2872)
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
parent
66568e3a39
commit
4f75591060
398 changed files with 58607 additions and 56442 deletions
|
@ -2,42 +2,42 @@
|
|||
|
||||
class N26Bridge extends BridgeAbstract
|
||||
{
|
||||
const MAINTAINER = 'quentinus95';
|
||||
const NAME = 'N26 Blog';
|
||||
const URI = 'https://n26.com';
|
||||
const CACHE_TIMEOUT = 1800;
|
||||
const DESCRIPTION = 'Returns recent blog posts from N26.';
|
||||
const MAINTAINER = 'quentinus95';
|
||||
const NAME = 'N26 Blog';
|
||||
const URI = 'https://n26.com';
|
||||
const CACHE_TIMEOUT = 1800;
|
||||
const DESCRIPTION = 'Returns recent blog posts from N26.';
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$limit = 5;
|
||||
$url = 'https://n26.com/en-eu/blog/all';
|
||||
$html = getSimpleHTMLDOM($url);
|
||||
public function collectData()
|
||||
{
|
||||
$limit = 5;
|
||||
$url = 'https://n26.com/en-eu/blog/all';
|
||||
$html = getSimpleHTMLDOM($url);
|
||||
|
||||
$articles = $html->find('div[class="bl bm"]');
|
||||
$articles = $html->find('div[class="bl bm"]');
|
||||
|
||||
foreach($articles as $article) {
|
||||
$item = array();
|
||||
foreach ($articles as $article) {
|
||||
$item = [];
|
||||
|
||||
$itemUrl = self::URI . $article->find('a', 1)->href;
|
||||
$item['uri'] = $itemUrl;
|
||||
$itemUrl = self::URI . $article->find('a', 1)->href;
|
||||
$item['uri'] = $itemUrl;
|
||||
|
||||
$item['title'] = $article->find('a', 1)->plaintext;
|
||||
$item['title'] = $article->find('a', 1)->plaintext;
|
||||
|
||||
$fullArticle = getSimpleHTMLDOM($item['uri']);
|
||||
$fullArticle = getSimpleHTMLDOM($item['uri']);
|
||||
|
||||
$createdAt = $fullArticle->find('time', 0);
|
||||
$item['timestamp'] = strtotime($createdAt->plaintext);
|
||||
$createdAt = $fullArticle->find('time', 0);
|
||||
$item['timestamp'] = strtotime($createdAt->plaintext);
|
||||
|
||||
$this->items[] = $item;
|
||||
if (count($this->items) >= $limit) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->items[] = $item;
|
||||
if (count($this->items) >= $limit) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getIcon()
|
||||
{
|
||||
return 'https://n26.com/favicon.ico';
|
||||
}
|
||||
public function getIcon()
|
||||
{
|
||||
return 'https://n26.com/favicon.ico';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue