1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-31 20:02:03 +02:00

Reformat codebase v4 (#2872)

Reformat code base to PSR12

Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
Dag
2022-07-01 15:10:30 +02:00
committed by GitHub
parent 66568e3a39
commit 4f75591060
398 changed files with 58607 additions and 56442 deletions

View File

@@ -1,37 +1,40 @@
<?php
class DavesTrailerPageBridge extends BridgeAbstract {
const MAINTAINER = 'johnnygroovy';
const NAME = 'Daves Trailer Page Bridge';
const URI = 'https://www.davestrailerpage.co.uk/';
const DESCRIPTION = 'Last trailers in HD thanks to Dave.';
public function collectData(){
$html = getSimpleHTMLDOM(static::URI)
or returnClientError('No results for this query.');
class DavesTrailerPageBridge extends BridgeAbstract
{
const MAINTAINER = 'johnnygroovy';
const NAME = 'Daves Trailer Page Bridge';
const URI = 'https://www.davestrailerpage.co.uk/';
const DESCRIPTION = 'Last trailers in HD thanks to Dave.';
$curr_date = null;
foreach ($html->find('tr') as $tr) {
// If it's a date row, update the current date
if ($tr->align == 'center') {
$curr_date = $tr->plaintext;
continue;
}
public function collectData()
{
$html = getSimpleHTMLDOM(static::URI)
or returnClientError('No results for this query.');
$item = array();
$curr_date = null;
foreach ($html->find('tr') as $tr) {
// If it's a date row, update the current date
if ($tr->align == 'center') {
$curr_date = $tr->plaintext;
continue;
}
// title
$item['title'] = $tr->find('td', 0)->find('b', 0)->plaintext;
$item = [];
// content
$item['content'] = $tr->find('ul', 1);
// title
$item['title'] = $tr->find('td', 0)->find('b', 0)->plaintext;
// uri
$item['uri'] = $tr->find('a', 3)->getAttribute('href');
// content
$item['content'] = $tr->find('ul', 1);
// date: parsed by FeedItem using strtotime
$item['timestamp'] = $curr_date;
// uri
$item['uri'] = $tr->find('a', 3)->getAttribute('href');
$this->items[] = $item;
}
}
// date: parsed by FeedItem using strtotime
$item['timestamp'] = $curr_date;
$this->items[] = $item;
}
}
}