-
Notifications
You must be signed in to change notification settings - Fork 26
/
indexer_popgo.php
43 lines (35 loc) · 1.08 KB
/
indexer_popgo.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
<?php
require_once('indexer_base.php');
class Indexer_Popgo Extends Indexer_Base {
protected $FEED_URL = 'http://share.popgo.org/rss/rss.xml';
public function fetch() {
$rs = $this->_fetch();
$ret = array();
foreach ($rs as $r) {
$match = NULL;
$btih = '';
preg_match('([0-9a-f]{40})', $r['guid'], $match);
if ($match) {
$btih = $match[0];
}
else {
LOGW("无法解析资源的 BTIH, r = " . var_export($r, TRUE));
continue;
}
$ret[] = array(
'btih' => $btih,
'title' => $r['title'],
'guid' => $r['guid'],
'link' => $r['link'],
'description' => $r['description'],
'pubDate' => strtotime($r['pubDate']),
'magnet' => '',
);
}
return $ret;
}
static public function getSrcSeedURL($btih) {
return popgo_get_seed_url($btih);
}
}
?>