forked from rmccue/test-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opml.php
39 lines (34 loc) · 747 Bytes
/
opml.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
<?php
/**
* OPML Parser
*
* @author Clint Ecker <[email protected]>
* @copyright Copyright (c) 2003 The MIT License
* @version 1.0.2
* @package External
* @subpackage OPML Parser
*/
class OPML {
var $file;
var $feeds;
var $template_file;
var $_links = array();
function OPML($file) {
$this->file = $file;
}
function parseOPMLtoArray() {
$parser = xml_parser_create();
$data = implode('', file($this->file));
xml_parse_into_struct($parser,$data,$d_ar,$i_ar);
foreach($d_ar as $element) {
if($element['tag'] == 'OUTLINE') {
$feeds[] = $element['attributes'];
}
}
$this->feeds = $feeds;
}
function load() {
echo "<a href=\"$path_to_opml/". basename($this->file) . "\">Download OPML File</a>";
}
}
?>