mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[FirefoxReleaseNotesBridge] Add New Bridge (#3930)
* [FirefoxReleaseNotesBridge] Add New Bridge I'm uncertain about the reasons for the failed checks. * Update FirefoxReleaseNotesBridge.php
This commit is contained in:
parent
c3a968193e
commit
a15e578158
1 changed files with 47 additions and 0 deletions
47
bridges/FirefoxReleaseNotesBridge.php
Normal file
47
bridges/FirefoxReleaseNotesBridge.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
class FirefoxReleaseNotesBridge extends BridgeAbstract
|
||||
{
|
||||
const NAME = 'Firefox Release Notes';
|
||||
const URI = 'https://www.mozilla.org/en-US/firefox/';
|
||||
const DESCRIPTION = 'Retrieve the latest Firefox release notes.';
|
||||
const MAINTAINER = 'tillcash';
|
||||
const PARAMETERS = [
|
||||
[
|
||||
'platform' => [
|
||||
'name' => 'Platform',
|
||||
'type' => 'list',
|
||||
'values' => [
|
||||
'Desktop' => '',
|
||||
'Beta' => 'beta',
|
||||
'Nightly' => 'nightly',
|
||||
'Android' => 'android',
|
||||
'iOS' => 'ios',
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
public function getName()
|
||||
{
|
||||
$platform = $this->getKey('platform');
|
||||
return sprintf('Firefox %s Release Notes', $platform ?? '');
|
||||
}
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
$platform = $this->getKey('platform');
|
||||
$url = self::URI . $this->getInput('platform') . '/notes/';
|
||||
$dom = getSimpleHTMLDOM($url);
|
||||
|
||||
$version = $dom->find('.c-release-version', 0)->innertext;
|
||||
|
||||
$this->items[] = [
|
||||
'content' => $dom->find('.c-release-notes', 0)->innertext,
|
||||
'timestamp' => $dom->find('.c-release-date', 0)->innertext,
|
||||
'title' => sprintf('Firefox %s %s Release Note', $platform, $version),
|
||||
'uri' => $url,
|
||||
'uid' => $platform . $version,
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue