Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Pie
#1
Hey!

I wondered if someone of you is using Simple Pie for including RSS-feeds into your site.
I was trying to do so today, but eventhough I ran the included test (which tells me that everything should work smoothly) I just don't get it done. Can someone help me?

The documentation on their website is not really helping me since it stops after installing simple pie. I successfully installed it, created a site by copying the given code in the documentation (changed it ot the right path of autoloader.php), saved it and tried to access it, but the only thing I get is:

Code:
Warning: include(C:\temp\xampp\htdocs\stwneu\php\library\library\SimplePie.php): failed to open stream: No such file or directory in C:\temp\xampp\htdocs\stwneu\php\library\autoloader.php on line 84

Warning: include(): Failed opening 'C:\temp\xampp\htdocs\stwneu\php\library\library\SimplePie.php' for inclusion (include_path='.;\temp\xampp\php\PEAR') in C:\temp\xampp\htdocs\stwneu\php\library\autoloader.php on line 84

Fatal error: Autoloader not registered properly in C:\temp\xampp\htdocs\stwneu\php\library\autoloader.php on line 51


Is someone experienced with simple pie and able to help? Confused
Reply
#2
library/library ?
path looks suspiciously wrong
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
Hey, thanks! There was indeed something wrong. I fixed the path, but it's not working either now. I don't get any error messages I just see the browser loading something/doing something before it suddenly stopps. 

This is the whole code I have:

Code:
<?php

// Make sure SimplePie is included. You may need to change this to match the location of autoloader.php
// For 1.0-1.2:

#require_once('../simplepie.inc');
// For 1.3+:
require_once('autoloader.php');

// We'll process this feed with all of the default options.
$feed = new SimplePie();

// Set which feed to process.
$feed->set_feed_url('http://www.spiegel.de/panorama/index.rss');

// Run SimplePie.
$feed->init();

// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
$feed->handle_content_type();

// Let's begin our XHTML webpage code.  The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag.
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

<html xmlns
<head>

    <title>Sample SimplePie Page</title>
    <meta
</head>
<body>

    <div class="header">
        <h1><a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a></h1>
        <p><?php echo $feed->get_description(); ?></p>
    </div>

    <?php
    /*
    Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
    */
    foreach ($feed->get_items() as $item):
    ?>

        <div class="item">
            <h2><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h2>
            <p><?php echo $item->get_description(); ?></p>
            <p><small>Posted on <?php echo $item->get_date('j F Y | g:i a'); ?></small></p>
        </div>

    <?php endforeach; ?>

</body>
</html>
Reply
#4
Quote:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

<html xmlns
<head>

   <title>Sample SimplePie Page</title>
   <meta
</head>
<body>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"      
Instead of: 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns         shouldn't that be <html xmlns> ?
<meta                   something is missing here?
Reply




Users browsing this thread: 1 Guest(s)