Skip to content

Commit

Permalink
KoFiBridge fix the "Call to a member function find() on null" line 39 (
Browse files Browse the repository at this point in the history
  • Loading branch information
walkero-gr authored Nov 28, 2023
1 parent b037d1b commit 609eed1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bridges/KoFiBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ public function collectData()
if (isset($titleWrapper[0])) {
$item = [];
$item['title'] = $element->find('div.content-link-text div')[0]->plaintext;
// $item['timestamp'] = strtotime($element->find('div.feeditem-time', 0)->plaintext);
$item['uri'] = self::URI . $element->find('div.fi-post-item-large a')[0]->href;
$uri = $element->find('div.content-link-text div')[2]->find('a')[0]->onclick;
$uri = trim(str_replace('window.location =', '', $uri));
$uri = trim(str_replace(''', '', $uri));
$uri = trim(str_replace(';', '', $uri));
$item['uri'] = self::URI . $uri;

if (isset($element->find('div.fi-post-item-large div.content-link-post img')[0])) {
$item['enclosures'][] = $element->find('div.fi-post-item-large div.content-link-post img')[0]->src;
}
// $item['content'] = $element->find('div.content-link-text div#content-link', 0)->plaintext;

$html = getSimpleHTMLDOM($item['uri']);
$feedItemTime = $html->find('div.feeditem-time', 0);
Expand Down

0 comments on commit 609eed1

Please sign in to comment.