WordPress.org

Ready to get started?Download WordPress

Forums

HungryFEED
[resolved] Add a table outside the description (10 posts)

  1. bluesteel124
    Member
    Posted 3 years ago #

    Jason,

    Is it possible to add the price of the apps from the feed? I believe it's outside the description in a table.

    I wouldn't mind adding the complete table.

    Here's the feed.

    http://ipadhelp.com/ipad-apps/top-ipad-apps-on-sale/

    Thanks,

    Phil

  2. Jason
    Member
    Plugin Author

    Posted 3 years ago #

    cool looking use of hungryFEED!

    well, the price field seems to be an extra, non-standard-rss field that Apple is including in their feed. Off the top of my head I doubt that WordPress RSS parser would recognize the field. If WordPress (SimplePie) doesn't parse that field then it wouldn't be accessible to HungryFEED either.

    It probably doesn't make sense to put a "price" field in HungryFEED since it's specific to that Apple feed. But perhaps I can find a way to include "custom" fields in a the template (if they are parsed by SimplePie and accessible).

    It's unfortunate they don't include that in the description then it would be possible to grab the price, but that doesn't seem to be the case.

  3. bluesteel124
    Member
    Posted 3 years ago #

    Thanks Jason for your fast response. You go above and beyond to support the HungryFeed plugin.

    I really want to promote this feed and a few others more on my site. It can be a nice way for iPad users to check and find deals while using their iPad or form a computer.. I think the feed looks better on the iPad using HungryFeed then using just the feed plus HungryFeed allows me to filter it.

    Feeds on the iPad look similar to feeds on the iPhone but with HungryFeed it looks just like a webpage. It would be nice to add the price though.

    Thanks again,

    Phil

  4. Jason
    Member
    Plugin Author

    Posted 3 years ago #

    it looks like WordPress does parse that extra data so i'll be able to make something that allows custom xml fields in templates. it's kinda ugly in the template it will probably look something like this:

    {data['child']['http://itunes.apple.com/rss']['price']['0']['data']}

    that's the way the structure shows up in the feeds, so it would make sense to just do it that way so any fields are supported. I still have to get it working though but I'll get that into the next release.

  5. Jason
    Member
    Plugin Author

    Posted 3 years ago #

    OK version 1.4.8 should be available within a few minutes and it supports the "data" fields in your template which allow you to basically include any field that is in the feed. The only difficult part is that you have to figure out what the path to your data is, which can be difficult.

    In your case, this variable in your template will give you the price:

    {{data['child']['http://itunes.apple.com/rss']['price']['0']['data']}}

    If you want to explore more fields, then you can temporarily use the parameter show_data="1" in your shortcode and it will output all of the data for each item, which you can use to investigate and debug.

  6. bluesteel124
    Member
    Posted 3 years ago #

    Sorry that I haven't replied, I was thinking I would get an email from WordPress whenever there was a response.

    Anyways, I updated the plugin, added the code to the template and it worked like a charm.

    That adds a very useful item to the feed. I plan on doing some more work on my feed pages and promoting them more on my site.

    Once again, you have been a big help. You and HugryFEED are awesome.

    Thanks,
    Phil

  7. nerdland
    Member
    Posted 3 years ago #

    Hey there. Excited about the possibilities of HungryFeed. I was trying this out, though, and kinda ran into a brick wall. I tried it out with the Apple RSS feed, just to try to get a grasp on how it works, and wasn't having any luck. I don't know if Apple has changed their fields in the 2 weeks since this was posted, but the field I found in the RSS feeds was albumPrice, not 'price'. I tried replacing that, but it still didn't display anything.

    The feed I actually need to use is YouTube's, but I was hoping I could figure it out if I could figure out the iTunes example. I know I can dig down with CSS with your tutorial, but this seems like it would be simpler if I could get it to work with the provided fields.

    An example feed URL is:
    http://gdata.youtube.com/feeds/api/users/youtube/uploads

    As you can see, they provide a 'thumbnail' field. It's used multiple times for different thumbnail sizes, but when I add show_data="1", I can see they're given numbers. (0, 1, 2, 3)

    I'm just not sure how to target that. Since I couldn't even get the example working, I don't really know how to hack it.

  8. Jason
    Member
    Plugin Author

    Posted 3 years ago #

    the schema is kinda complicated, but you can get the thumbnail url from YouTube feeds using a template like this, for example:

    <div class="hungryfeed_item">
    <div><a href="{{permalink}}">{{title}}</a></div>
    <div><img src="{{data['child']['http://search.yahoo.com/mrss/']['group']['0']['child']['http://search.yahoo.com/mrss/']['thumbnail']['0']['attribs']['']['url']}}" /></div>
    </div>

    the last '0' in the data expression can be changed to return the other thumbnails (0,1, 2 or 3)

  9. nerdland
    Member
    Posted 3 years ago #

    Thanks so much! That worked, but I don't totally understand what the "http://search.yahoo.com/mrss/" is all about, or where that's coming from. What IS that all about?

  10. Jason
    Member
    Plugin Author

    Posted 3 years ago #

    That's an XML schema. Apparently the Yahoo schema must have already been published and had some level of popularity. YouTube chose to implement that instead of re-inventing the wheel with their own proprietary XML format.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags