diff options
Diffstat (limited to 'src/HTMLParser.php')
-rw-r--r-- | src/HTMLParser.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 98269cc..5acb4ea 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -122,7 +122,14 @@ class HTMLParser $this->getNodes($root); - $this->rateNodes($this->elementsToScore); + $result = $this->rateNodes($this->elementsToScore); + + // Todo, fix return, check for values, maybe create a function to create the return object + return [ + 'title' => $this->metadata['title'], + 'author' => $this->metadata['author'], + 'article' => $result + ]; } /** @@ -290,6 +297,7 @@ class HTMLParser * Assign scores to each node. This function will rate each node and return a Readability object for each one. * * @param array $nodes + * @return DOMDocument */ private function rateNodes($nodes) { @@ -481,7 +489,8 @@ class HTMLParser $articleContent->appendChild($import); } } - $test = 1; + + return $articleContent; } private function checkByline($node, $matchString) |