mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[InternetArchiveBridge] Fix collection links (#1551)
This commit is contained in:
parent
3aafd44079
commit
f904353fd2
@ -42,7 +42,6 @@ class InternetArchiveBridge extends BridgeAbstract {
|
|||||||
$html = defaultLinkTo($html, $this->getURI());
|
$html = defaultLinkTo($html, $this->getURI());
|
||||||
|
|
||||||
if ($this->getInput('content') !== 'posts') {
|
if ($this->getInput('content') !== 'posts') {
|
||||||
|
|
||||||
$detailsDivNumber = 0;
|
$detailsDivNumber = 0;
|
||||||
|
|
||||||
foreach ($html->find('div.results > div[data-id]') as $index => $result) {
|
foreach ($html->find('div.results > div[data-id]') as $index => $result) {
|
||||||
@ -54,7 +53,6 @@ class InternetArchiveBridge extends BridgeAbstract {
|
|||||||
|
|
||||||
switch($result->class) {
|
switch($result->class) {
|
||||||
case 'item-ia':
|
case 'item-ia':
|
||||||
|
|
||||||
switch($this->getInput('content')) {
|
switch($this->getInput('content')) {
|
||||||
case 'reviews':
|
case 'reviews':
|
||||||
$item = $this->processReview($result);
|
$item = $this->processReview($result);
|
||||||
@ -104,7 +102,6 @@ class InternetArchiveBridge extends BridgeAbstract {
|
|||||||
public function getName() {
|
public function getName() {
|
||||||
|
|
||||||
if (!is_null($this->getInput('username')) && !is_null($this->getInput('content'))) {
|
if (!is_null($this->getInput('username')) && !is_null($this->getInput('content'))) {
|
||||||
|
|
||||||
$contentValues = array_flip(self::PARAMETERS['Account']['content']['values']);
|
$contentValues = array_flip(self::PARAMETERS['Account']['content']['values']);
|
||||||
|
|
||||||
return $contentValues[$this->getInput('content')] . ' - '
|
return $contentValues[$this->getInput('content')] . ' - '
|
||||||
@ -124,11 +121,10 @@ class InternetArchiveBridge extends BridgeAbstract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function processUpload($result) {
|
private function processUpload($result) {
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$collection = $result->find('a.stealth', 0);
|
$collection = $result->find('a.stealth', 0);
|
||||||
$collectionLink = self::URI . $collection->href;
|
$collectionLink = $collection->href;
|
||||||
$collectionTitle = $collection->find('div.item-parent-ttl', 0)->plaintext;
|
$collectionTitle = $collection->find('div.item-parent-ttl', 0)->plaintext;
|
||||||
|
|
||||||
$item['title'] = trim($result->find('div.ttl', 0)->innertext);
|
$item['title'] = trim($result->find('div.ttl', 0)->innertext);
|
||||||
@ -150,7 +146,6 @@ EOD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function processReview($result) {
|
private function processReview($result) {
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$item['title'] = trim($result->find('div.ttl', 0)->innertext);
|
$item['title'] = trim($result->find('div.ttl', 0)->innertext);
|
||||||
@ -172,7 +167,6 @@ EOD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function processWebArchives($result) {
|
private function processWebArchives($result) {
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$item['title'] = trim($result->find('div.ttl', 0)->plaintext);
|
$item['title'] = trim($result->find('div.ttl', 0)->plaintext);
|
||||||
@ -189,7 +183,6 @@ EOD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function processCollection($result) {
|
private function processCollection($result) {
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$title = trim($result->find('div.collection-title.C.C2', 0)->children(0)->plaintext);
|
$title = trim($result->find('div.collection-title.C.C2', 0)->children(0)->plaintext);
|
||||||
@ -209,7 +202,6 @@ EOD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function processHiddenDetails($html, $detailsDivNumber, $item) {
|
private function processHiddenDetails($html, $detailsDivNumber, $item) {
|
||||||
|
|
||||||
$description = '';
|
$description = '';
|
||||||
|
|
||||||
if ($html->find('div.details-ia.hidden-tiles', $detailsDivNumber)) {
|
if ($html->find('div.details-ia.hidden-tiles', $detailsDivNumber)) {
|
||||||
@ -237,7 +229,6 @@ EOD;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function processPosts($html) {
|
private function processPosts($html) {
|
||||||
|
|
||||||
$items = array();
|
$items = array();
|
||||||
|
|
||||||
foreach ($html->find('table.forumTable > tr') as $index => $tr) {
|
foreach ($html->find('table.forumTable > tr') as $index => $tr) {
|
||||||
@ -288,6 +279,7 @@ EOD;
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user