From e99cbf21b2e70f2e572fc3a4a0a341bb82119838 Mon Sep 17 00:00:00 2001 From: Bocki Date: Fri, 12 Aug 2022 14:51:38 +0200 Subject: [PATCH] [DailyShirts] Add daily shirt sites (#2962) --- bridges/QwerteeBridge.php | 34 +++++++++++++++++++++++++++++++ bridges/RiptApparelBridge.php | 37 ++++++++++++++++++++++++++++++++++ bridges/TeefuryBridge.php | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 bridges/QwerteeBridge.php create mode 100644 bridges/RiptApparelBridge.php create mode 100644 bridges/TeefuryBridge.php diff --git a/bridges/QwerteeBridge.php b/bridges/QwerteeBridge.php new file mode 100644 index 00000000..937fa98d --- /dev/null +++ b/bridges/QwerteeBridge.php @@ -0,0 +1,34 @@ +find('div.big-slides', 0)->find('div.big-slide') as $element) { + $title = $element->find('div.index-tee', 0)->getAttribute('data-name', 0); + $today = date('m/d/Y'); + $item = []; + $item['uri'] = self::URI; + $item['title'] = $title; + $item['uid'] = $title; + $item['timestamp'] = $today; + $item['content'] = ''; + + $this->items[] = $item; + } + } +} diff --git a/bridges/RiptApparelBridge.php b/bridges/RiptApparelBridge.php new file mode 100644 index 00000000..2732a5ed --- /dev/null +++ b/bridges/RiptApparelBridge.php @@ -0,0 +1,37 @@ +find('div.daily-designs', 0)->find('div.collection') as $element) { + $title = $element->find('div.design-info', 0)->find('div.title', 0)->innertext; + $uri = self::URI . $element->find('div.design-info', 0)->find('a', 0)->href; + $today = date('m/d/Y'); + $imagesrcset = $element->find('div.design-images', 0)->find('div[data-subtype="Mens"]', 0)->find('img', 0); + $image = rtrim(explode(',', $imagesrcset->getAttribute('data-srcset'))[2], ' 900w'); + $item = []; + $item['uri'] = $uri; + $item['title'] = $title; + $item['uid'] = $title; + $item['timestamp'] = $today; + $item['content'] = ''; + + $this->items[] = $item; + } + } +} diff --git a/bridges/TeefuryBridge.php b/bridges/TeefuryBridge.php new file mode 100644 index 00000000..54828698 --- /dev/null +++ b/bridges/TeefuryBridge.php @@ -0,0 +1,38 @@ +find('div.odad-card__wrapper') as $element) { + $titletext = $element->find('p', 0)->innertext; + $title = trim(explode('
', $titletext)[0]); + $today = date('m/d/Y'); + $uri = self::URI . $element->find('div.js-odad-link', 1)->attr['data-link']; + $item = []; + $item['uri'] = $uri; + $item['title'] = $title; + $item['uid'] = $title; + $item['timestamp'] = $today; + $item['content'] = $element->find('p', 0) + . '
'; + + $this->items[] = $item; + } + } +}