forked from radgeek/feedwordpress
-
Notifications
You must be signed in to change notification settings - Fork 1
/
magpiemocklink.class.php
46 lines (34 loc) · 1.12 KB
/
magpiemocklink.class.php
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
44
<?php
require_once(dirname(__FILE__) . '/syndicatedlink.class.php');
class MagpieMockLink extends SyndicatedLink {
var $url;
function MagpieMockLink ($rss, $url) {
$this->link = $rss;
if (is_array($rss) and isset($rss['simplepie']) and isset($rss['magpie'])) :
$this->simplepie = $rss['simplepie'];
$this->magpie = $rss['magpie'];
else :
$this->magpie = $rss;
endif;
$this->url = $url;
$this->id = -1;
$this->settings = array(
'unfamiliar category' => 'default',
);
} /* function MagpieMockLink::MagpieMockLink () */
function poll ($crash_ts = NULL) {
// Do nothing but update copy of feed
$this->simplepie = FeedWordPress::fetch($this->url);
$this->magpie = new MagpieFromSimplePie($this->simplepie);
$this->link = $this->magpie;
} /* function MagpieMockLink::poll () */
function uri () {
return $this->url;
} /* function MagpieMockLink::uri() */
function homepage () {
return (!is_wp_error($this->simplepie) ? $this->simplepie->get_link() : null);
} /* function MagpieMockLink::homepage () */
function save_settings ($reload = false) {
// NOOP.
}
} /* class MagpieMockLink */