diff options
author | DriverXX <DriverXX@users.noreply.github.com> | 2019-12-24 09:33:19 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2019-12-24 09:33:19 +0100 |
commit | 6673cbc3d940745a0ecddb93b32805a0fbe79eb1 (patch) | |
tree | 72d50a36c4635311a684375106652d88d019575e /lib/Scraper/IScraper.php | |
parent | c2f617dd400681b67927781a73a735600803d9ae (diff) |
Reimplement full-text scraping (#563)
Add readability.php scraper
Fixes #482
Signed-off-by: Gioele Falcetti <thegio.f@gmail.com>
Diffstat (limited to 'lib/Scraper/IScraper.php')
-rw-r--r-- | lib/Scraper/IScraper.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Scraper/IScraper.php b/lib/Scraper/IScraper.php new file mode 100644 index 000000000..b389b79c9 --- /dev/null +++ b/lib/Scraper/IScraper.php @@ -0,0 +1,43 @@ +<?php +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Gioele Falcetti <thegio.f@gmail.com> + * @copyright 2019 Gioele Falcetti + */ + +namespace OCA\News\Scraper; + +interface IScraper +{ + /** + * Scrape feed url + * + * @param string $url + * + * @return bool False if failed + * + */ + public function scrape(string $url): bool; + + /** + * Get the scraped content + * + * @return string + * + */ + public function getContent(): string; + + /** + * Get the RTL (rigth-to-left) information + * + * @param bool $default Return this value if the scraper is unable to determine it + * + * @return bool + * + */ + public function getRTL(bool $default = false): bool; +} |