summaryrefslogtreecommitdiffstats
path: root/lib/Scraper/IScraper.php
blob: 687b9b02ca739d36139523bf9000c00989217f62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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|null
     *
     */
    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;
}