aboutsummaryrefslogtreecommitdiff
path: root/bridges/DavesTrailerPageBridge.php
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/DavesTrailerPageBridge.php')
-rw-r--r--bridges/DavesTrailerPageBridge.php57
1 files changed, 30 insertions, 27 deletions
diff --git a/bridges/DavesTrailerPageBridge.php b/bridges/DavesTrailerPageBridge.php
index 88e0bbb3..965f7e59 100644
--- a/bridges/DavesTrailerPageBridge.php
+++ b/bridges/DavesTrailerPageBridge.php
@@ -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;
+ }
+ }
}