[InternetArchiveBridge] Fix collection links (#1551)

This commit is contained in:
Joseph 2021-03-16 13:07:04 +00:00 committed by GitHub
parent 3aafd44079
commit f904353fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -42,7 +42,6 @@ class InternetArchiveBridge extends BridgeAbstract {
$html = defaultLinkTo($html, $this->getURI());
if ($this->getInput('content') !== 'posts') {
$detailsDivNumber = 0;
foreach ($html->find('div.results > div[data-id]') as $index => $result) {
@ -54,7 +53,6 @@ class InternetArchiveBridge extends BridgeAbstract {
switch($result->class) {
case 'item-ia':
switch($this->getInput('content')) {
case 'reviews':
$item = $this->processReview($result);
@ -104,7 +102,6 @@ class InternetArchiveBridge extends BridgeAbstract {
public function getName() {
if (!is_null($this->getInput('username')) && !is_null($this->getInput('content'))) {
$contentValues = array_flip(self::PARAMETERS['Account']['content']['values']);
return $contentValues[$this->getInput('content')] . ' - '
@ -124,11 +121,10 @@ class InternetArchiveBridge extends BridgeAbstract {
}
private function processUpload($result) {
$item = array();
$collection = $result->find('a.stealth', 0);
$collectionLink = self::URI . $collection->href;
$collectionLink = $collection->href;
$collectionTitle = $collection->find('div.item-parent-ttl', 0)->plaintext;
$item['title'] = trim($result->find('div.ttl', 0)->innertext);
@ -150,7 +146,6 @@ EOD;
}
private function processReview($result) {
$item = array();
$item['title'] = trim($result->find('div.ttl', 0)->innertext);
@ -172,7 +167,6 @@ EOD;
}
private function processWebArchives($result) {
$item = array();
$item['title'] = trim($result->find('div.ttl', 0)->plaintext);
@ -189,7 +183,6 @@ EOD;
}
private function processCollection($result) {
$item = array();
$title = trim($result->find('div.collection-title.C.C2', 0)->children(0)->plaintext);
@ -209,7 +202,6 @@ EOD;
}
private function processHiddenDetails($html, $detailsDivNumber, $item) {
$description = '';
if ($html->find('div.details-ia.hidden-tiles', $detailsDivNumber)) {
@ -237,7 +229,6 @@ EOD;
}
private function processPosts($html) {
$items = array();
foreach ($html->find('table.forumTable > tr') as $index => $tr) {
@ -288,6 +279,7 @@ EOD;
break;
}
}
return $items;
}
}