-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathmagpiemocklink.class.php
50 lines (37 loc) · 1.23 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
45
46
47
48
<?php
require_once(dirname(__FILE__) . '/syndicatedlink.class.php');
class MagpieMockLink extends SyndicatedLink {
var $url;
function __construct( $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 MagpieMockLink( $rss, $url ) {
self::__construct( $rss, $url );
}
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 ($params = array()) {
return $this->url;
} /* function MagpieMockLink::uri() */
function homepage ($fromFeed = true) {
return ( !is_wp_error($this->simplepie) ? $this->simplepie->get_link() : null);
} /* function MagpieMockLink::homepage () */
function save_settings ($reload = false) {
// NOOP.
}
} /* class MagpieMockLink */