Welcome Guest, Not a member yet? Register   Sign In
Unable to find the wrapper "feed" RSSParser Library
#1

[eluser]nnash[/eluser]
I'm currently having a problem with the RSSParser Library (the one in the CI wiki) where I am getting this error

Code:
Severity: Warning

Message: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "feed" - did you forget to enable it when you configured PHP?

Filename: libraries/RSSParser.php

Line Number: 89

I believe it is in reference to this code

Code:
<?php
    //Load the shiny new rssparse
    $this->load->library('RSSParser',array('url' => 'feed://api.flickr.com/services/feeds/photos_public.gne?id=30842919@N04&lang=en-us&format=rss_200', 'life' => 2));
    //Get six items from the feed
    $data = $this->rssparser->getFeed(6);
    foreach ($data as $item) :
       // do stuff with $item['title'], $item['description'], etc.
       echo '<h2>' . $item['title'] . '</h2>';
       echo '<abbr>' . $item['date'] . '</abbr>';
       echo $item['image'];
    endforeach;    
?&gt;

I also get this error:
Code:
Severity: Warning

Message: file_get_contents(feed://...@N04&lang=en-us&format=rss_200) [function.file-get-contents]: failed to open stream: No such file or directory

Filename: libraries/RSSParser.php

Line Number: 89

For some reason the RSSParser library doesn't seem to be liking the "feed://" part of the rss url, does anyone know how to fix this?
#2

[eluser]Sverri[/eluser]
The first error message says that the function, file_get_contents() (which is used in the RSS class), is missing the wrapper (the code that handles the feed:// protocol). Try changing the protocol to http:// instead.

The second error message says that it cannot find anything at the provided URL. This can mean a lot of things, but usually it is because there simply is nothing there. Again, changing the protocol to http:// may fix this.

Please do not take this the wrong way, but PHP produces excellent error messages. Use them. You will run into them frequently, and the answers are right in-front of you, more often than not.
#3

[eluser]nnash[/eluser]
If I change the wrapper to http:// these messages are produced:


Code:
Severity: Notice

Message: Undefined variable: cache_dir

Filename: libraries/RSSParser.php

Line Number: 114

Edit:
The undefined cache_dir variable on line 114 of the RSSParser library that CodeIgniter published on their wiki is simple a log_message() that can be commented out.
End Edit

Now it is saying there is compile error with the RSSParser class, since I did not write it I don't really know what the error could be since I just copy and pasted it from the CI wiki, which you can find here http://codeigniter.com/wiki/RSSParser/.

Code:
Severity: Notice

Message: Undefined property: CI_Loader::$rssparser

Filename: theme/content.php

Line Number: 24

The second error message is in reference to the fifth line in the second code block on my first post.
#4

[eluser]nnash[/eluser]
I think one of the things that I need to do to get this to work is to get feed listed as a registered php stream. Does anyone know how to easily do this? I'm using MAMP.




Theme © iAndrew 2016 - Forum software by © MyBB