1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-01-17 22:28:22 +01:00

fix: more verbose error in fb (#3089)

This commit is contained in:
Dag 2022-10-05 19:30:42 +02:00 committed by GitHub
parent 44e5bf5338
commit 5d18852108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -553,7 +553,8 @@ EOD;
$header = []; $header = [];
} }
$html = getSimpleHTMLDOM($this->getURI(), $header); $url = $this->getURI();
$html = getSimpleHTMLDOM($url, $header);
} }
// Handle captcha form? // Handle captcha form?
@ -571,12 +572,17 @@ EOD;
returnServerError('You must be logged in to view this page. This is not supported by RSS-Bridge.'); returnServerError('You must be logged in to view this page. This is not supported by RSS-Bridge.');
} }
$element = $html file_put_contents('/tmp/a.html', "$html");
->find('#pagelet_timeline_main_column')[0] $mainColumn = $html->find('#pagelet_timeline_main_column');
->children(0) if (!$mainColumn) {
->children(0) throw new \Exception(sprintf('Unable to find anything useful in %s', $url));
->next_sibling() }
->children(0);
$element = $mainColumn[0]
->children(0)
->children(0)
->next_sibling()
->children(0);
if (isset($element)) { if (isset($element)) {
$author = str_replace(' - Posts | Facebook', '', $html->find('title#pageTitle', 0)->innertext); $author = str_replace(' - Posts | Facebook', '', $html->find('title#pageTitle', 0)->innertext);