Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InternetArchiveBridge] Fix collection links #1551

Merged
merged 2 commits into from
Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions bridges/InternetArchiveBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function collectData() {
$html = defaultLinkTo($html, $this->getURI());

if ($this->getInput('content') !== 'posts') {

$detailsDivNumber = 0;

foreach ($html->find('div.results > div[data-id]') as $index => $result) {
Expand All @@ -54,7 +53,6 @@ public function collectData() {

switch($result->class) {
case 'item-ia':

switch($this->getInput('content')) {
case 'reviews':
$item = $this->processReview($result);
Expand Down Expand Up @@ -104,7 +102,6 @@ public function getURI() {
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')] . ' - '
Expand All @@ -124,11 +121,10 @@ private function processUsername() {
}

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);
Expand All @@ -150,7 +146,6 @@ private function processUpload($result) {
}

private function processReview($result) {

$item = array();

$item['title'] = trim($result->find('div.ttl', 0)->innertext);
Expand All @@ -172,7 +167,6 @@ private function processReview($result) {
}

private function processWebArchives($result) {

$item = array();

$item['title'] = trim($result->find('div.ttl', 0)->plaintext);
Expand All @@ -189,7 +183,6 @@ private function processWebArchives($result) {
}

private function processCollection($result) {

$item = array();

$title = trim($result->find('div.collection-title.C.C2', 0)->children(0)->plaintext);
Expand All @@ -209,7 +202,6 @@ private function processCollection($result) {
}

private function processHiddenDetails($html, $detailsDivNumber, $item) {

$description = '';

if ($html->find('div.details-ia.hidden-tiles', $detailsDivNumber)) {
Expand Down Expand Up @@ -237,7 +229,6 @@ private function processHiddenDetails($html, $detailsDivNumber, $item) {
}

private function processPosts($html) {

$items = array();

foreach ($html->find('table.forumTable > tr') as $index => $tr) {
Expand Down Expand Up @@ -288,6 +279,7 @@ private function processPosts($html) {
break;
}
}

return $items;
}
}