WordPress.org

Ready to get started?Download WordPress

Forums

HungryFEED
Can't Select an Image from RSS Feed (3 posts)

  1. novacode7
    Member
    Posted 2 years ago #

    I'm using HungryFeed on a school multisite installation to create a homepage that will load the RSS feeds from some of the teachers' individual blogs. I have the principal's RSS feed (http://principal.crusaders.ourladyofhope.net) coming over perfectly onto the Principal tab on the homepage (http://crusaders.ourladyofhope.net) with one exception: I can't get the image to load.

    I've tried variations of <img src="{{select(attr:src).img:first}}"> with no success. Any ideas?

    http://wordpress.org/extend/plugins/hungryfeed/

  2. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    The selector only works if the image is in the description of the post (ie if the post description is simple HTML). You could verify if that is the case by looking at the feed source.

    If the image is not in the post description field then it may be stored by the blog software in another "extended" field of RSS. To get to those fields you have to use the "data array" feature of HungryFEED which is simple to use, but unfortunately can be a minor pain figuring out the correct path to the image.

  3. novacode7
    Member
    Posted 2 years ago #

    Thank you for your quick response. Using the data array feature I've tracked down the image. It's only located here in the data feed:

    {{data['child']['http://purl.org/rss/1.0/modules/content/']['encoded'][0]['data']}}

    Unfortunately, when I use this data array it brings over the post text and image. Is there a way to specify more precisely the image only? Here's the relevant data dump:

    [http://purl.org/rss/1.0/modules/content/] => Array
                    (
                        [encoded] => Array
                            (
                                [0] => Array
                                    (
                                        [data] => <p><img class="alignleft size-full wp-image-36" title="School Crest" src="http://principal.crusaders.ourladyofhope.net/files/2012/03/School-Crest.png" alt="" width="121" height="94" />Make sure to show your Crusader pride on Spirit Day, March 28!</p>
    
                                        [attribs] => Array
                                            (
                                            )
    
                                        [xml_base] =>
                                        [xml_base_explicit] =>
                                        [xml_lang] =>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags