mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
[bridges] Change all occurrences of the Item object to array
This commit is contained in:
parent
1f3361c6b4
commit
bf0a9d754e
130 changed files with 844 additions and 844 deletions
|
@ -34,8 +34,8 @@ class CollegeDeFranceBridge extends BridgeAbstract{
|
|||
*/
|
||||
$html = $this->getSimpleHTMLDOM('http://www.college-de-france.fr/components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all') or $this->returnServerError('Could not request CollegeDeFrance.');
|
||||
foreach($html->find('a[data-target]') as $element) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('.title', 0)->plaintext;
|
||||
$item = array();
|
||||
$item['title'] = $element->find('.title', 0)->plaintext;
|
||||
// Most relative URLs contains an hour in addition to the date, so let's use it
|
||||
// <a href="/site/yann-lecun/course-2016-04-08-11h00.htm" data-target="after">
|
||||
//
|
||||
|
@ -46,9 +46,9 @@ class CollegeDeFranceBridge extends BridgeAbstract{
|
|||
$timezone = new DateTimeZone('Europe/Paris');
|
||||
// strpos($element->href, '201') will break in 2020 but it'll probably break prior to then due to site changes anyway
|
||||
$d = DateTime::createFromFormat('!Y-m-d-H\hi', substr($element->href, strpos($element->href, '201'), 16), $timezone) ?: DateTime::createFromFormat('!d m Y', trim(str_replace(array_values($months), array_keys($months), $element->find('.date', 0)->plaintext)), $timezone);
|
||||
$item->timestamp = $d->format('U');
|
||||
$item->content = $element->find('.lecturer', 0)->innertext . ' - ' . $element->find('.title', 0)->innertext;
|
||||
$item->uri = 'http://www.college-de-france.fr' . $element->href;
|
||||
$item['timestamp'] = $d->format('U');
|
||||
$item['content'] = $element->find('.lecturer', 0)->innertext . ' - ' . $element->find('.title', 0)->innertext;
|
||||
$item['uri'] = 'http://www.college-de-france.fr' . $element->href;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue