aboutsummaryrefslogtreecommitdiff
path: root/bridges/NikonDownloadCenterBridge.php
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/NikonDownloadCenterBridge.php')
-rw-r--r--bridges/NikonDownloadCenterBridge.php63
1 files changed, 34 insertions, 29 deletions
diff --git a/bridges/NikonDownloadCenterBridge.php b/bridges/NikonDownloadCenterBridge.php
index 88b33c41..143d40f5 100644
--- a/bridges/NikonDownloadCenterBridge.php
+++ b/bridges/NikonDownloadCenterBridge.php
@@ -1,34 +1,39 @@
<?php
-class NikonDownloadCenterBridge extends BridgeAbstract {
- const NAME = 'Nikon Download Center – What\'s New';
- const URI = 'https://downloadcenter.nikonimglib.com/';
- const DESCRIPTION = 'Firmware updates and new software from Nikon.';
- const MAINTAINER = 'sal0max';
- const CACHE_TIMEOUT = 60 * 60 * 2; // 2 hours
- public function getURI() {
- $year = date('Y');
- return self::URI . 'en/update/index/' . $year . '.html';
- }
+class NikonDownloadCenterBridge extends BridgeAbstract
+{
+ const NAME = 'Nikon Download Center – What\'s New';
+ const URI = 'https://downloadcenter.nikonimglib.com/';
+ const DESCRIPTION = 'Firmware updates and new software from Nikon.';
+ const MAINTAINER = 'sal0max';
+ const CACHE_TIMEOUT = 60 * 60 * 2; // 2 hours
- public function getIcon() {
- return self::URI . 'favicon.ico';
- }
+ public function getURI()
+ {
+ $year = date('Y');
+ return self::URI . 'en/update/index/' . $year . '.html';
+ }
- public function collectData() {
- $html = getSimpleHTMLDOM($this->getURI());
+ public function getIcon()
+ {
+ return self::URI . 'favicon.ico';
+ }
- foreach ($html->find('dd>ul>li') as $element) {
- $date = $element->find('.date', 0)->plaintext;
- $productType = $element->find('.icon>img', 0)->alt;
- $desc = $element->find('p>a', 0)->plaintext;
- $link = urljoin(self::URI, $element->find('p>a', 0)->href);
+ public function collectData()
+ {
+ $html = getSimpleHTMLDOM($this->getURI());
- $item = array(
- 'title' => $desc,
- 'uri' => $link,
- 'timestamp' => strtotime($date),
- 'content' => <<<EOD
+ foreach ($html->find('dd>ul>li') as $element) {
+ $date = $element->find('.date', 0)->plaintext;
+ $productType = $element->find('.icon>img', 0)->alt;
+ $desc = $element->find('p>a', 0)->plaintext;
+ $link = urljoin(self::URI, $element->find('p>a', 0)->href);
+
+ $item = [
+ 'title' => $desc,
+ 'uri' => $link,
+ 'timestamp' => strtotime($date),
+ 'content' => <<<EOD
<p>
New/updated {$productType}:<br>
<strong><a href="{$link}">{$desc}</a></strong>
@@ -37,8 +42,8 @@ class NikonDownloadCenterBridge extends BridgeAbstract {
{$date}
</p>
EOD
- );
- $this->items[] = $item;
- }
- }
+ ];
+ $this->items[] = $item;
+ }
+ }
}