ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Magpie Problems

February 18, 2011 10:31am

Subscribe [4]
  • #1 / Feb 18, 2011 10:31am

    jretzer

    57 posts

    I’m trying to include RSS feeds in a post Here’s what I’ve done: First, I created a custom field called rssfeed. Magpie is installed. Then, I use this code under Body in my template

    {exp:magpie url="{rssfeed}" limit="20" refresh="30"}
    {magpie:items}
    <li>
    <a href="http://{magpie:link}">{magpie:title}</a>
    
    {magpie:description}
    {magpie:about}
    </li>
    {/magpie:items}
    {/exp:magpie}

    I’m not getting anything from this though, and there’s an error message at the top of the page:

    Warning: MagpieRSS: Failed to fetch /www/eh9881/public_html/Engine/plugins/pi.magpie.php on line 1390

    Notice: Trying to get property of non-object in /www/eh9881/public_html/Engine/plugins/pi.magpie.php on line 105

    Any ideas on how to solve this one? TIA

  • #2 / Feb 18, 2011 3:15pm

    Ingmar

    29245 posts

    Can you show us a little more of your code? What happens when you try the example code in an otherwise empty template? What version and build of EE are you using?

  • #3 / Feb 18, 2011 7:33pm

    jretzer

    57 posts

    I’m running EE 1.6.9 build 20100805

    I get the same thing in a blank template

    Here’s more of the code around the magpie ...

    {exp:weblog:entries weblog="{master_weblog_name}"  orderby="date" sort="desc" limit="10" disable="trackbacks" cache="yes" refresh="30"}
    
    <div class="entry">
    {entry_date format=' %l, %F %d, %Y '}
    <h2>{title}</h2>
    <p><h3 class="categories">{categories weblog="{master_weblog_name}" backspace="7"} <a href="http://{path={template_group_name}/index}">{category_name}</a>, {/categories}</h3>  <br />
    {body}</p>
    
    <p>{exp:magpie url="{rssfeed}" limit="20" refresh="30"}<br />
    {magpie:items}<br />
    <li><br />
    <a href="http://{magpie:link}">{magpie:title}</a></p>
    
    <p>{magpie:description}<br />
    {magpie:about}<br />
    </li><br />
    {/magpie:items}<br />
    {/exp:magpie}</p>
    
    <p>{if extended != ""}<br />
    <a href="http://{title_permalink={template_group_name}/comments}" class="readmore">Continued…</a><br />
    {/if}</p>
    
    <p> </p>
    
    
    
    <p> </p>
    
    <p><br />
    {if allow_comments}<br />
    <a href="http://{title_permalink=">Entry Permalink and Comments</a> | <a href="http://www.miniaturewargaming.com/index.php/market/categories/%22&gtEmail">List All Posts By Category</a><br />
    {/if}</p>
    
    <p>{paginate}</p>
    
    <p><br />
    Page {current_page} of {total_pages} pages</span>  {pagination_links}</p>
    
    <p><br />
    {/paginate}</p>
    
    <p></div><!-- entry --><br />
    {/exp:weblog:entries}

  • #4 / Feb 20, 2011 2:24pm

    Greg Salt

    3988 posts

    Hi jretzer,

    If you hard-code the feed URL into the Magpie tag does it then work?

    Cheers

    Greg

  • #5 / Feb 20, 2011 7:26pm

    jretzer

    57 posts

    We’re on to something here. If I put an actual link instead of the brackets and rssfeed, then I get a result.

  • #6 / Feb 20, 2011 7:40pm

    Mark Bowen

    12637 posts

    Looks like this is probably a parse order issue to me.

    I’m guessing that if you turn on template debugging in the preferences so that you see the actual queries created for that template then you would probably see {rssfeed} in the query instead of the URL that you want. Hard coding the link of course gets around that problem.

    Another way around it would be to embed a template which has the magpie code in it and call that inside the weblog entries tag, somewhat like this :

    {exp:weblog:entries weblog="{master_weblog_name}"  orderby="date" sort="desc" limit="10" disable="trackbacks" cache="yes" refresh="30"}
    
    …YOUR CODE…
    
    
    {embed="includes/magpie_template" feed="{rssfeed}"}
    
    
    …YOUR CODE…
    
    {/exp:weblog:entries}

    includes/magpie_template

    {exp:magpie url="{embed:rssfeed}" limit="20" refresh="30"}
    {magpie:items}
    <li>
    <a href="http://{magpie:link}">{magpie:title}</a>
    
    {magpie:description}
    {magpie:about}
    </li>
    {/magpie:items}
    {/exp:magpie}

    Hopefully that should then work for you.

    Best wishes,

    Mark

  • #7 / Feb 20, 2011 8:03pm

    jretzer

    57 posts

    Still no output.

    The curious thing about this is that I have an identical setup in another EE blog ... same version ... same plugin ... same host (EE Hosting) and it works fine there as I originally had it set up.

  • #8 / Feb 20, 2011 8:27pm

    Mark Bowen

    12637 posts

    Now might definitely be a good time to turn on the template debugging preferences to see just exactly what is going on here.

    Best wishes,

    Mark

  • #9 / Feb 20, 2011 8:40pm

    jretzer

    57 posts

    That output is HUGE ... what should I be looking for?

  • #10 / Feb 20, 2011 8:41pm

    Mark Bowen

    12637 posts

    Also ensure that the custom field has its formatting set to None. Both in the weblog custom fields setting and also the entry for that item.

    Also check that you have automatic conversion of URLs turned off in the weblog preferences too. I just tried with the code I posted above and it didn’t work at first until I checked those two things and then it all started working.

    Best wishes,

    Mark

  • #11 / Feb 20, 2011 11:38pm

    jretzer

    57 posts

    I checked it. The settings are good.

  • #12 / Feb 21, 2011 6:59am

    Mark Bowen

    12637 posts

    Just out of interest, what’s the RSS feed link so that I can try it myself with the code I have set up at the moment.

  • #13 / Feb 21, 2011 12:44pm

    jretzer

    57 posts

    It’s an ebay feed for a particular search. What I’ve done on my other site is set up the ability to get the affiliate rss feeds and publish them as a post. When I write about a (golf) product on that site, I can attach an ebay search feed so people can compare prices and (hopefully) buy something. Here’s the RSS in question for the other site (toy soldiers). It works fine when I put it into the golf site, but not the toy soldier site:

    http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&dfsp=32&from=R6&nojspr=y&output=RSS20&saaff=afepn&siteId=0
    &afepn=5336789968&customid;=&satitle=ancient&sacat=16486&catref=C5&fbfmt=1&sabfmts=0&sascs=0&fsop=32&fsoo=2

  • #14 / Feb 21, 2011 1:31pm

    jretzer

    57 posts

    Ok. So I started over. Deleted the field. deleted the experimental posts, reset all the templates, then redid the code in the templates.

    And now it works.

  • #15 / Feb 21, 2011 1:43pm

    Mark Bowen

    12637 posts

    I’m fairly certain it will have been a field formatting preference somewhere along the line as it normally is with this type of thing. Could have been that maybe your field was created originally with Auto
    or XHTML perhaps and then when submitting the entry you turned that off for the field which normally should do it but I believe in this instance that you need to go back to the field formatting preferences and update all fields for this to work.

    Not sure if that’s a bug or not though.

    Anyway glad it’s working for you now though.

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases