3 * Class used to parse RSS and ATOM feeds
5 * @author Andreas Gohr <andi@splitbrain.org>
8 if(!defined('DOKU_INC')) die('meh.');
9 require_once(DOKU_INC
.'inc/HTTPClient.php');
10 require_once(DOKU_INC
.'inc/SimplePie.php');
14 * We override some methods of the original SimplePie class here
16 class FeedParser
extends SimplePie
{
19 * Constructor. Set some defaults
21 function FeedParser(){
23 $this->enable_cache(false);
24 $this->set_file_class('FeedParser_File');
28 * Backward compatibility for older plugins
30 function feed_url($url){
31 $this->set_feed_url($url);
36 * Fetch an URL using our own HTTPClient
38 * Replaces SimplePie's own class
40 class FeedParser_File
extends SimplePie_File
{
44 var $headers = array();
49 * Inititializes the HTTPClient
51 * We ignore all given parameters - they are set in DokuHTTPClient
53 function FeedParser_File($url, $timeout=10, $redirects=5,
54 $headers=null, $useragent=null, $force_fsockopen=false) {
55 $this->http
= new DokuHTTPClient();
56 $this->success
= $this->http
->sendRequest($url);
58 $this->headers
= $this->http
->resp_headers
;
59 $this->body
= $this->http
->resp_body
;
60 $this->error
= $this->http
->error
;
61 return $this->success
;
65 return $this->headers
;