forked from blallo/rss-bridge
[EZTVBridge] fix + code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
d0cfeed3cf
commit
cee272ba6e
1 changed files with 3 additions and 6 deletions
|
@ -29,16 +29,13 @@ class EZTVBridge extends BridgeAbstract{
|
||||||
return mktime(date('h')-$relativeHours,0,0,date('m'),date('d')-$relativeDays,date('Y'));
|
return mktime(date('h')-$relativeHours,0,0,date('m'),date('d')-$relativeDays,date('Y'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for ID provided
|
|
||||||
if (!isset($this->getInput('i')))
|
|
||||||
$this->returnClientError('You must provide a list of ID (?i=showID1,showID2,...)');
|
|
||||||
|
|
||||||
// Loop on show ids
|
// Loop on show ids
|
||||||
$showList = explode(",",$this->getInput('i'));
|
$showList = explode(",",$this->getInput('i'));
|
||||||
foreach($showList as $showID){
|
foreach($showList as $showID){
|
||||||
|
|
||||||
// Get show page
|
// Get show page
|
||||||
$html = $this->getSimpleHTMLDOM('https://eztv.ch/shows/'.rawurlencode($showID).'/') or $this->returnServerError('Could not request EZTV for id "'.$showID.'"');
|
$html = $this->getSimpleHTMLDOM($this->uri.'shows/'.rawurlencode($showID).'/')
|
||||||
|
or $this->returnServerError('Could not request EZTV for id "'.$showID.'"');
|
||||||
|
|
||||||
// Loop on each element that look like an episode entry...
|
// Loop on each element that look like an episode entry...
|
||||||
foreach($html->find('.forum_header_border') as $element) {
|
foreach($html->find('.forum_header_border') as $element) {
|
||||||
|
@ -56,7 +53,7 @@ class EZTVBridge extends BridgeAbstract{
|
||||||
|
|
||||||
// Fill item
|
// Fill item
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = 'https://eztv.ch/'.$epinfo->href;
|
$item['uri'] = $this->uri.$epinfo->href;
|
||||||
$item['id'] = $item['uri'];
|
$item['id'] = $item['uri'];
|
||||||
$item['timestamp'] = makeTimestamp($released->plaintext);
|
$item['timestamp'] = makeTimestamp($released->plaintext);
|
||||||
$item['title'] = $epinfo->plaintext;
|
$item['title'] = $epinfo->plaintext;
|
||||||
|
|
Loading…
Reference in a new issue