mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 14:24:39 +03:00
[FirefoxAddonsBridge] Fix download link extraction (#2120)
This commit is contained in:
parent
44e01a4282
commit
f02d80e141
1 changed files with 8 additions and 7 deletions
|
@ -41,23 +41,24 @@ class FirefoxAddonsBridge extends BridgeAbstract {
|
||||||
$this->feedName = $html->find('h1[class="AddonTitle"] > a', 0)->innertext;
|
$this->feedName = $html->find('h1[class="AddonTitle"] > a', 0)->innertext;
|
||||||
$author = $html->find('span.AddonTitle-author > a', 0)->plaintext;
|
$author = $html->find('span.AddonTitle-author > a', 0)->plaintext;
|
||||||
|
|
||||||
foreach ($html->find('div.AddonVersionCard-content') as $div) {
|
foreach ($html->find('li.AddonVersionCard') as $li) {
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$item['title'] = $div->find('h2.AddonVersionCard-version', 0)->plaintext;
|
$item['title'] = $li->find('h2.AddonVersionCard-version', 0)->plaintext;
|
||||||
|
$item['title'] = $li->find('h2.AddonVersionCard-version', 0)->plaintext;
|
||||||
$item['uid'] = $item['title'];
|
$item['uid'] = $item['title'];
|
||||||
$item['uri'] = $this->getURI();
|
$item['uri'] = $this->getURI();
|
||||||
$item['author'] = $author;
|
$item['author'] = $author;
|
||||||
|
|
||||||
if (preg_match($this->releaseDateRegex, $div->find('div.AddonVersionCard-fileInfo', 0)->plaintext, $match)) {
|
if (preg_match($this->releaseDateRegex, $li->find('div.AddonVersionCard-fileInfo', 0)->plaintext, $match)) {
|
||||||
$item['timestamp'] = $match[1];
|
$item['timestamp'] = $match[1];
|
||||||
$size = $match[2];
|
$size = $match[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
$compatibility = $div->find('div.AddonVersionCard-compatibility', 0)->plaintext;
|
$compatibility = $li->find('div.AddonVersionCard-compatibility', 0)->plaintext;
|
||||||
$license = $div->find('p.AddonVersionCard-license', 0)->innertext;
|
$license = $li->find('p.AddonVersionCard-license', 0)->innertext;
|
||||||
$downloadlink = $div->find('a.InstallButtonWrapper-download-link', 0)->href;
|
$downloadlink = $li->find('a.InstallButtonWrapper-download-link', 0)->href;
|
||||||
$releaseNotes = $this->removeOutgoinglink($div->find('div.AddonVersionCard-releaseNotes', 0));
|
$releaseNotes = $this->removeOutgoinglink($li->find('div.AddonVersionCard-releaseNotes', 0));
|
||||||
|
|
||||||
if (preg_match($this->xpiFileRegex, $downloadlink, $match)) {
|
if (preg_match($this->xpiFileRegex, $downloadlink, $match)) {
|
||||||
$xpiFilename = $match[0];
|
$xpiFilename = $match[0];
|
||||||
|
|
Loading…
Add table
Reference in a new issue