Skip to content

Commit

Permalink
Crawl application description
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Mar 30, 2018
1 parent f85a80a commit 437864f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 0.2.2 (2018-03-30)

### Fixed
- Crawl application description

## 0.2.1 (2018-03-30)

### Fixed
- Remove no longer supported fields due to google play html structure change

## 0.2.0 (2016-11-10)

### Added
Expand Down
26 changes: 1 addition & 25 deletions src/Scraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ public function getApp($id, $lang = null, $country = null)
$info['url'] = $crawler->filter('[itemprop="url"]')->attr('content');
$info['image'] = $this->getAbsoluteUrl($crawler->filter('[itemprop="image"]')->attr('src'));
$info['title'] = $crawler->filter('[itemprop="name"] > span')->text();
// author no longer supported
//$info['author'] = $crawler->filter('[itemprop="author"] [itemprop="name"]')->text();
//$info['author_link'] = $this->getAbsoluteUrl($crawler->filter('[itemprop="author"] > [itemprop="url"]')->attr('content'));
$info['categories'] = $crawler->filter('[itemprop="genre"]')->each(function ($node) {
return $node->text();
});
Expand All @@ -123,7 +120,7 @@ public function getApp($id, $lang = null, $country = null)
$info['screenshots'] = $crawler->filter('[itemprop="screenshot"]')->each(function ($node) {
return $this->getAbsoluteUrl($node->filter('img')->attr('src'));
});
$desc = $this->cleanDescription($crawler->filter('[itemprop="description"] > div'));
$desc = $this->cleanDescription($crawler->filter('[itemprop="description"] > content > div'));
$info['description'] = $desc['text'];
$info['description_html'] = $desc['html'];
$ratingNode = $crawler->filter('[itemprop="aggregateRating"] > [itemprop="ratingValue"]');
Expand All @@ -140,8 +137,6 @@ public function getApp($id, $lang = null, $country = null)
$votes = 0;
}
$info['votes'] = $votes;
// no longer supported
//$info['last_updated'] = trim($crawler->filter('[itemprop="datePublished"]')->text());
$sizeNode = $crawler->filter('[itemprop="fileSize"]');
if ($sizeNode->count()) {
$size = trim($sizeNode->text());
Expand All @@ -163,25 +158,6 @@ public function getApp($id, $lang = null, $country = null)
$version = null;
}
$info['version'] = $version;
// no longer supported
/*$info['supported_os'] = trim($crawler->filter('[itemprop="operatingSystems"]')->text());
$info['content_rating'] = $crawler->filter('[itemprop="contentRating"]')->text();
$whatsneNode = $crawler->filter('.recent-change');
if ($whatsneNode->count()) {
$info['whatsnew'] = implode("\n", $whatsneNode->each(function ($node) {
return $node->text();
}));
} else {
$info['whatsnew'] = null;
}
$videoNode = $crawler->filter('.details-trailer');
if ($videoNode->count()) {
$info['video_link'] = $this->getAbsoluteUrl($videoNode->filter('.play-action-container')->attr('data-video-url'));
$info['video_image'] = $this->getAbsoluteUrl($videoNode->filter('.video-image')->attr('src'));
} else {
$info['video_link'] = null;
$info['video_image'] = null;
}*/

return $info;
}
Expand Down

0 comments on commit 437864f

Please sign in to comment.