mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-10 00:48:48 +00:00
[FirefoxAddonsBridge] Add detectParameters() (#1997)
This commit is contained in:
parent
5c011c8d90
commit
700813e924
@ -21,6 +21,19 @@ class FirefoxAddonsBridge extends BridgeAbstract {
|
|||||||
private $xpiFileRegex = '/([A-Za-z0-9_.-]+)\.xpi$/';
|
private $xpiFileRegex = '/([A-Za-z0-9_.-]+)\.xpi$/';
|
||||||
private $outgoingRegex = '/https:\/\/outgoing.prod.mozaws.net\/v1\/(?:[A-z0-9]+)\//';
|
private $outgoingRegex = '/https:\/\/outgoing.prod.mozaws.net\/v1\/(?:[A-z0-9]+)\//';
|
||||||
|
|
||||||
|
private $urlRegex = '/addons\.mozilla\.org\/(?:[\w-]+\/)?firefox\/addon\/([\w-]+)/';
|
||||||
|
|
||||||
|
public function detectParameters($url) {
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if(preg_match($this->urlRegex, $url, $matches)) {
|
||||||
|
$params['id'] = $matches[1];
|
||||||
|
return $params;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function collectData() {
|
public function collectData() {
|
||||||
$html = getSimpleHTMLDOM($this->getURI())
|
$html = getSimpleHTMLDOM($this->getURI())
|
||||||
or returnServerError('Could not request: ' . $this->getURI());
|
or returnServerError('Could not request: ' . $this->getURI());
|
||||||
|
Loading…
Reference in New Issue
Block a user