mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-29 14:48:52 +03:00
Adding a bridge for theyetee.com (#809)
* Adding a bridge for theyetee.com The bridge fetches daily shirts at theyetee.com. The Yetee offers two new shirts each day, but you can buy them only for a few hours ! Unfortunately, the site don't provide RSS feed, so the only way to keep up to date on new shirt is their daily mailing ... until now !
This commit is contained in:
parent
458b826871
commit
5722a6c139
1 changed files with 41 additions and 0 deletions
41
bridges/TheYeteeBridge.php
Normal file
41
bridges/TheYeteeBridge.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
class TheYeteeBridge extends BridgeAbstract {
|
||||
|
||||
const MAINTAINER = 'Monsieur Poutounours';
|
||||
const NAME = 'TheYetee';
|
||||
const URI = 'https://theyetee.com';
|
||||
const CACHE_TIMEOUT = 14400; // 4 h
|
||||
const DESCRIPTION = 'Fetch daily shirts from The Yetee';
|
||||
|
||||
public function collectData(){
|
||||
|
||||
$html = getSimpleHTMLDOM(self::URI)
|
||||
or returnServerError('Could not request The Yetee.');
|
||||
|
||||
$div = $html->find('.hero-col');
|
||||
foreach($div as $element) {
|
||||
|
||||
$item = array();
|
||||
$item['enclosures'] = array();
|
||||
|
||||
$title = $element->find('h2', 0)->plaintext;
|
||||
$item['title'] = $title;
|
||||
|
||||
$author = trim($element->find('div[class=credit]', 0)->plaintext);
|
||||
$item['author'] = $author;
|
||||
|
||||
$uri = $element->find('div[class=controls] a', 0)->href;
|
||||
$item['uri'] = static::URI.$uri;
|
||||
|
||||
$content = '<p>'.$element->find('section[class=product-listing-info] p', -1)->plaintext.'</p>';
|
||||
$photos = $element->find('a[class=js-modaal-gallery] img');
|
||||
foreach($photos as $photo) {
|
||||
$content = $content."<br /><img src='$photo->src' />";
|
||||
$item['enclosures'][] = $photo->src;
|
||||
}
|
||||
$item['content'] = $content;
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue