Skip to content

Commit

Permalink
fix(cnet): author typo (#4042)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored Mar 31, 2024
1 parent 17a3b4c commit 9682f74
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bridges/CNETBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function collectData()
foreach ($links as $article_uri) {
$article_dom = convertLazyLoading(getSimpleHTMLDOMCached($article_uri));
$title = trim($article_dom->find('h1', 0)->plaintext);
$author = $article_dom->find('span.c-assetAuthor_name', 0)->plaintext;
$author = $article_dom->find('span.c-assetAuthor_name', 0);
$headline = $article_dom->find('p.c-contentHeader_description', 0);
$content = $article_dom->find('div.c-pageArticle_content, div.single-article__content, div.article-main-body', 0);
$date = null;
Expand Down Expand Up @@ -97,7 +97,11 @@ public function collectData()
$item = [];
$item['uri'] = $article_uri;
$item['title'] = $title;
$item['author'] = $author;

if ($author) {
$item['author'] = $author->plaintext;
}

$item['content'] = $content;

if (!is_null($date)) {
Expand Down

0 comments on commit 9682f74

Please sign in to comment.