1 | <?php |
||
15 | class YoutubeFetcher implements IFeedFetcher { |
||
16 | |||
17 | private $feedFetcher; |
||
18 | |||
19 | public function __construct(FeedFetcher $feedFetcher){ |
||
22 | |||
23 | |||
24 | private function buildUrl($url) { |
||
35 | |||
36 | |||
37 | /** |
||
38 | * This fetcher handles all the remaining urls therefore always returns true |
||
39 | */ |
||
40 | public function canHandle($url){ |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Fetch a feed from remote |
||
47 | * @param string $url remote url of the feed |
||
48 | * @param boolean $getFavicon if the favicon should also be fetched, |
||
49 | * defaults to true |
||
50 | * @param string $lastModified a last modified value from an http header |
||
51 | * defaults to false. If lastModified matches the http header from the feed |
||
52 | * no results are fetched |
||
53 | * @param string $etag an etag from an http header. |
||
54 | * If lastModified matches the http header from the feed |
||
55 | * no results are fetched |
||
56 | * @param bool fullTextEnabled if true tells the fetcher to enhance the |
||
57 | * articles by fetching custom enhanced content |
||
58 | * @param string $basicAuthUser if given, basic auth is set for this feed |
||
59 | * @param string $basicAuthPassword if given, basic auth is set for this |
||
60 | * feed. Ignored if user is null or an empty string |
||
61 | * @throws FetcherException if it fails |
||
62 | * @return array an array containing the new feed and its items, first |
||
63 | * element being the Feed and second element being an array of Items |
||
64 | */ |
||
65 | public function fetch($url, $getFavicon=true, $lastModified=null, |
||
80 | |||
81 | |||
82 | } |
||
83 |