Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
RSS Parser - Can Pro Display RSS 2.0 Feeds?
Posted: 15 March 2005 01:47 PM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  18
Joined  2005-02-24

Hi I am trying to include external feeds on my index.php page by using the Parser Include Tag:

<?php show_rss_page("template_name","url_to_rss_page","10"); ?>

I am using my default weblog template called “weblog” and i am using the XML feed URL. Specifically, I am trying to use a MoreOver Feed and Display last 10 entries.

I have done the above - and now my include tag looks like:

<?php show_rss_page("weblog","http://p.moreover.com/page?o=rss002&query=ebay","10"); ?>

However, my page shows blank?! Is this because PMPro can only display RSS .091 feeds? Or am I doing something wrong or forgot something?

Thanks.

-P

Profile
 
 
Posted: 15 March 2005 03:56 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  2002-06-19

The built-in XML parser is very basic, I’m afraid.  If you want to be able to display other feed types (RSS 2.0, Atom, etc.) then I’d suggest trying something like the Magpie Parser script, which you ought to be able to use within your pMachine .php pages.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 24 March 2005 05:27 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  18
Joined  2005-02-24

Speaking of Magpie! (-;

I was looking for some help and couldn’t find it on Magpie’s site or elsewhere so perhaps somone from this forum would have a fix?!

I too am using Magpie to display a feed on my PMPro Site and it works fine with Magpie. But, I am trying to include another feed on the SAME page and it isn’t displaying.

My current Magpie code (that works) looks like:

<?php
include(’./mag/magpierss/rss_fetch.inc’);// Set error reporting for this
error_reporting(E_ERROR);// Fetch RSS feed
$rss = fetch_rss(‘http://blog.searchenginewatch.com/blog/blog.xml’);
if ($rss)
{
// Split the array to show first 10
$items = array_slice($rss->items, 0, 10);
// Cycle through each item and echo
foreach ($items as $item )
{  echo ‘<a href=”’.$item[‘link’].’”>’.$item[‘title’].’</a> - ‘.$item[‘author’].’<br />’;
echo “<b>Publish Date: ” . $item[pubdate] . “</b><br>\n”;
      echo $item[ description ] . “</p>” ;

}}else {  echo ‘<h2>Error:</h2><p>’.magpie_error().’</p>’;}// Restore original error reporting value@ini_restore(‘error_reporting’);?>

But if I copy/paste the same code for my 2nd Feed I get an error and it doesn’t display.

I was wondering if there was something simple like in the area where it says:

$rss = fetch_rss('http://blog.searchenginewatch.com/blog/blog.xml');

Couldn’t one put two(2) urls there? Anyone using Magpie to display 2 feeds? If so..can you share your code?

Thanks.

-P

Profile
 
 
Posted: 24 March 2005 11:32 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  2002-06-19

I think you simply need to leave off the first two lines when you use the code the second time:

nclude('./mag/magpierss/rss_fetch.inc');// Set error reporting for this
error_reporting(E_ERROR);// Fetch RSS feed

Those only need to appear on your page once in order for Magpie to work.  Trying to include it twice could cause errors (though since you never say what error you get I don’t know if it’s from that).

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 64509 Total Logged-in Users: 0
Total Topics: 81067 Total Anonymous Users: 0
Total Replies: 436294 Total Guests: 22
Total Posts: 517361    
Members ( View Memberlist )
Active Members: