Loading ...
Sorry, an error occurred while loading the content.

Re: [SimplePie] Re: Multifeeds with different Icons

Expand Messages
  • Gabriel Crow
    Good, glad to hear it and that I could help! Thanks for the site compliment too :)
    Message 1 of 30 , Aug 22, 2008
    View Source
    • 0 Attachment
      Good, glad to hear it and that I could help!

      Thanks for the site compliment too  :)

      osieak wrote:

      Gabriel, thanks! Your example doesn't seem to suffer from the issue I
      encountered. Got this working in minutes with a few little layout
      changes. Thanks. Nice site btw.

      --- In simplepie-support@ yahoogroups. com, "Gabriel" <yahoo@...> wrote:
      >
      > For reference, here is the full code I'm using for the page with the
      > multifeed + matched custom icons. This link will be good for 6 months:
      >
      > http://pastebin. ca/1181386
      >
      > set_item_limit( ) works as expected for me, 30 distinct feeds in the
      > multifeed and the limit tested up to 10 per feed. I have a test page
      > that uses the code linked above with the exception that it dumps all
      > the feeds and has a 10 per limit, feel free to take a look here:
      >
      > http://www.truevent ures.com/ feedtest -- sorting of the multiple feeds
      > appears fine to me.
      >
      > Hope this helps,
      > Gabe
      >
      > --- In simplepie-support@ yahoogroups. com, Michael Shipley
      > <michael@> wrote:
      > >
      > > Oh that stupid pastebin! This is strange. What are the feeds so I can
      > > check them.
      > >
      > > Michael P. Shipley
      > > www.michaelpshipley .com <http://www.michaelp shipley.com>
      > >
      > >
      > > osieak wrote:
      > > > So I've done a little more testing and here's what I've found.
      > > >
      > > > By including $feed->set_item_ limit(4); all seems to work properly by
      > > > sorting stories by pudDate in ascending order.
      > > >
      > > > Example:
      > > >
      > > > Story 08/21/08 6pm car.com
      > > > Story 08/21/08 5pm car.com
      > > > Story 08/21/08 4pm bus.com
      > > > Story 08/21/08 3pm train.com
      > > > Story 08/21/08 2pm boat.com
      > > > Story 08/21/08 1pm bike.com
      > > > Story 08/20/08 9pm car.com
      > > > Story 08/20/08 6pm bus.com
      > > > Story 08/20/08 3pm train.com
      > > > Story 08/20/08 1pm boat.com
      > > > ..
      > > >
      > > > However, when setting an item limit greater than 4, this is
      where the
      > > > grouping of stories occurs. Stories will now only be sorted, but in
      > > > groups from originating source.
      > > >
      > > > Example:
      > > >
      > > > Story 08/21/08 6pm car.com
      > > > Story 08/21/08 5pm car.com
      > > > Story 08/21/08 4pm car.com
      > > > Story 08/21/08 3pm car.com
      > > > Story 08/21/08 2pm car.com
      > > > Story 08/21/08 1pm car.com
      > > > Story 08/21/08 5pm bus.com
      > > > Story 08/21/08 4pm bus.com
      > > > Story 08/21/08 3pm bus.com
      > > > Story 08/21/08 2pm bus.com
      > > > ..
      > > >
      > > >
      > > > What I'm trying to do is aggregate multipliable feeds (20+) on
      to one
      > > > page with the following restraints.
      > > >
      > > > - Only show 100 stories in total.
      > > > - Stories are sorted by pubDate, ascending newest to oldest.
      > > > - Do not let the most active feeds dominate total, set_item_limit( 8)
      > > >
      > > > Optional
      > > > - Show favicon in front of each story title from originating site.
      > > >
      > > >
      > > > The pastepin included in this thread was deleted, would be cool if
      > > > somebody had the example still.
      > > >
      > > >
      > > >
      > > > --- In simplepie-support@ yahoogroups. com, "osieak" <osieak@> wrote:
      > > >
      > > >> Yes sir, all feeds have the pubDate. :)
      > > >>
      > > >> --- In simplepie-support@ yahoogroups. com, Ryan Parman
      > > >> <simplepie.support@ > wrote:
      > > >>
      > > >>> Have you seen
      > > >>>
      > > > http://simplepie. org/wiki/ faq/typical_ multifeed_ gotchas ?
      > > >
      > > >>>
      > > >>>
      > > >>>
      > > >>> On Aug 20, 2008, at 1:06 PM, osieak wrote:
      > > >>>
      > > >>>
      > > >>>> Unfortunately the pastebin related to this has been removed,
      > > >>>>
      > > > otherwise
      > > >
      > > >>>> it sounds exactly like something I could use. Mike, would you
      > happen
      > > >>>> to this suggestion laying around still? I'm currently playing
      > > >>>>
      > > > with the
      > > >
      > > >>>> 'sort multifeeds by time and date' tutorial, everything seems
      to be
      > > >>>> working except the stories are all grouped together by
      source. I'd
      > > >>>> like them based on date published. Any help?
      > > >>>>
      > > >>>> Link to the code I'm playing with:
      > > >>>> http://simplepie. org/wiki/ tutorial/
      > > >>>> sort_multiple_ feeds_by_ time_and_ date
      > > >>>>
      > > >>>>
      > > >>>> --- In simplepie-support@ yahoogroups. com, "Gabriel" <yahoo@>
      wrote:
      > > >>>>
      > > >>>>> Awesome, you rock. I love explosions and implosions! I now have
      > > >>>>> everything working with SP Core using caching (using a
      separately
      > > >>>>> called file to populate the cache) and icons matched per
      feed :)
      > > >>>>>
      > > >>>>> Here is the resultant cobbled together code (this isn't live so
      > > >>>>> prelaunch sensitive company path/urls made generic):
      > > >>>>>
      > > >>>>> http://simplepie. pastebin. com/m7af35ed5
      > > >>>>>
      > > >>>>> There is one lingering issue that I almost didn't catch that I'm
      > > >>>>> hoping you can help me with. The output is being sorted in the
      > > >>>>>
      > > > order
      > > >
      > > >>>>> of the feeds in the array, not by item date. So it's
      returning the
      > > >>>>> latest post of the 1st N (8 in the pastebin code above) feeds
      > > >>>>>
      > > > in the
      > > >
      > > >>>>> array as the N items output. What I'm looking to accomplish
      is the
      > > >>>>> output of the latest N items out of all the combined items
      > > >>>>>
      > > > across all
      > > >
      > > >>>>> feeds. Hopefully that makes sense.
      > > >>>>>
      > > >>>>> Please point me in the right direction, I think perhaps I'm
      > > >>>>> misunderstanding what stage the enable_order_ by_date has an
      > > >>>>>
      > > > effect
      > > >
      > > >>>>> on?
      > > >>>>> Upon closer examination it looks like it ensures that the items
      > > >>>>>
      > > > in a
      > > >
      > > >>>>> given feed are sorted by date, not that all the pulled in items
      > > >>>>>
      > > > from
      > > >
      > > >>>>> all feeds are mixed and sorted.
      > > >>>>>
      > > >>>>> Thanks again (so much!) for all the help, Padawan-O-Some- Pie!
      > > >>>>>
      > > >>>>> Gabe
      > > >>>>>
      > > >>>>> --- In simplepie-support@ yahoogroups. com, Michael Shipley
      > > >>>>> <michael@> wrote:
      > > >>>>>
      > > >>>>>> To limit total items returned, just call the "get_items"
      function
      > > >>>>>>
      > > >>>> with
      > > >>>>
      > > >>>>>> two parameters. The first parameter is the item you want to
      start
      > > >>>>>>
      > > >>>> with,
      > > >>>>
      > > >>>>>> the second is the number of items you want returned.
      > > >>>>>>
      > > >>>>>> For instance, to start at item 0 and return a total of 10
      > > >>>>>>
      > > > items, you
      > > >
      > > >>>>>> would do this:
      > > >>>>>>
      > > >>>>>> foreach($feed- >get_items( 0,10) as $item)
      > > >>>>>> {
      > > >>>>>> echo $item->get_title( );
      > > >>>>>> // etc...
      > > >>>>>> }
      > > >>>>>>
      > > >>>>>> There is no equivalent item description truncate function in SP
      > > >>>>>>
      > > >>>>> classic.
      > > >>>>>
      > > >>>>>> You could do something very simple like:
      > > >>>>>>
      > > >>>>>> $truncDesc =
      substr(strip_ tags($item- >get_description ()),0,50) +
      > > >>>>>>
      > > >>>> '...';
      > > >>>>
      > > >>>>>> Or you could use this much cooler,
      > > >>>>>> "smart-truncate- by-number- of-characters" , function that the
      > > >>>>>> "Masta-O-Da- Pie", Mr. Ryan Parman, whipped up:
      > > >>>>>>
      > > >>>>>>
      > http://simplepie. org/wiki/ tutorial/ shorten_titles_ and_descriptions
      > > >>>>>>
      > > >>>>>> Or you could use a much more cooler-er,
      > > >>>>>> "genius-level- truncate- by-number- of-words" function that the
      > > >>>>>> "Padawan-O-Some- Pie", Michael Shipley, laid down. You'll
      like it
      > > >>>>>> because there's lots of stuff exploding and imploding. ;-)
      > > >>>>>>
      > > >>>>>> http://simplepie. pastebin. com/f5c3b288b
      > > >>>>>>
      > > >>>>>> Michael P. Shipley
      > > >>>>>> www.michaelpshipley .com <http://www.michaelp shipley.com>
      > > >>>>>>
      > > >>>>>>
      > > >>>>>> Gabriel Crow wrote:
      > > >>>>>>
      > > >>>>>>> Thanks Mike, that's about what I expected. I'll switch my code
      > > >>>>>>>
      > > >>>>> over to
      > > >>>>>
      > > >>>>>>> SP Core and get it working first, then perhaps try my hand at
      > > >>>>>>> extending the class. I've looked through the API for SP Core
      > > >>>>>>>
      > > > and it
      > > >
      > > >>>>>>> looks straightforward enough, just one question there... using
      > > >>>>>>>
      > > >>>> SPWP I
      > > >>>>
      > > >>>>>>> can limit the number of items per input feed as well as the
      > > >>>>>>>
      > > >>>> number of
      > > >>>>
      > > >>>>>>> items to output from the multifeed. I see the limit items per
      > > >>>>>>>
      > > >>>> feed in
      > > >>>>
      > > >>>>>>> SP Core but I don't see anything for limiting the output. Is
      > > >>>>>>>
      > > > there
      > > >
      > > >>>>>>> something I'm missing or do I just need to make a function
      > > >>>>>>>
      > > >>>> myself to
      > > >>>>
      > > >>>>>>> limit it? Same question for truncating text.
      > > >>>>>>>
      > > >>>>>>> If I do need to make functions for these can you tell me
      around
      > > >>>>>>>
      > > >>>> what
      > > >>>>
      > > >>>>>>> lines of SPWP source I can look to for reference? I'm thinking
      > > >>>>>>>
      > > >>>> for my
      > > >>>>
      > > >>>>>>> skill level it will be easiest to extend SP Core with just the
      > > >>>>>>> modified/extracted bits of SPWP that I will use + any bits
      > > >>>>>>>
      > > >>>>> relevant to
      > > >>>>>
      > > >>>>>>> the icons and caching.
      > > >>>>>>> Sound about right?
      > > >>>>>>>
      > > >>>>>>> Michael Shipley wrote:
      > > >>>>>>>
      > > >>>>>>>> As far as I know you'd have to revert to standard SimplePie
      > (aka
      > > >>>>>>>> SimplePie Core) in order to use this technique since this
      is a
      > > >>>>>>>>
      > > >>>>> custom
      > > >>>>>
      > > >>>>>>>> solution beyond the abilities of SPWP.
      > > >>>>>>>>
      > > >>>>>>>> Your right, autodiscovery would present a problem since the
      > > >>>>>>>>
      > > >>>> feed_url
      > > >>>>
      > > >>>>>>>> variable would change. For this to work you would need to
      > > >>>>>>>>
      > > > use the
      > > >
      > > >>>>>>>> actual feed url. Or, you could extend the standard SimplePie
      > > >>>>>>>>
      > > > class
      > > >
      > > >>>>>>>> and add code to save the initial url to "saved_feed_ url"
      > and use
      > > >>>>>>>>
      > > >>>>> that
      > > >>>>>
      > > >>>>>>>> variable instead but that would be a non trivial task and
      > > >>>>>>>>
      > > >>>> definitely
      > > >>>>
      > > >>>>>>>> beyond the scope of SPWP.
      > > >>>>>>>>
      > > >>>>>>>>
      > > >>>>>>>> Michael P. Shipley
      > > >>>>>>>> www.michaelpshipley .com <http://www.michaelp shipley.com>
      > > >>>>>>>>
      > > >>>>>>>>
      > > >>>>>>>> Gabriel wrote:
      > > >>>>>>>>
      > > >>>>>>>>> Cool, makes sense. I assume then that I need to make sure my
      > > >>>>>>>>>
      > > >>>>> array has
      > > >>>>>
      > > >>>>>>>>> the full source feed url and not leave anything up to
      > > >>>>>>>>>
      > > >>>>> 'autodiscovery' .
      > > >>>>>
      > > >>>>>>>>> I prefer the real feed vs autodiscovery anyway, but I'm not
      > > >>>>>>>>>
      > > >>>> going to
      > > >>>>
      > > >>>>>>>>> be managing the list of feeds -- ideally I'll set it up to
      > pull
      > > >>>>>>>>>
      > > >>>>> out of
      > > >>>>>
      > > >>>>>>>>> Wordpress links within a specified category to make it easy
      > > >>>>>>>>>
      > > >>>> for the
      > > >>>>
      > > >>>>>>>>> non technically inclined to manage... but that's another
      day.
      > > >>>>>>>>>
      > > >>>>>>>>> I'm using SimplePieWP. .. how best to handle the
      > > >>>>>>>>>
      > > >>>> output/formatting of
      > > >>>>
      > > >>>>>>>>> this? I assume the SimplePieWP templates don't parse PHP.
      > > >>>>>>>>> Should I
      > > >>>>>>>>> rework everything to SimplePie Core, or is there a way
      to tell
      > > >>>>>>>>>
      > > >>>>> SPWP to
      > > >>>>>
      > > >>>>>>>>> ignore the template and use the API tags?
      > > >>>>>>>>>
      > > >>>>>>>>> Thanks again for all the pointers,
      > > >>>>>>>>> Gabe
      > > >>>>>>>>>
      > > >>>>>>>>> --- In simplepie-support@ yahoogroups. com, Michael Shipley
      > > >>>>>>>>> <michael@> wrote:
      > > >>>>>>>>>
      > > >>>>>>>>>
      > > >>>>>>>>>> Actually I thought of a better way to do this. Each feed
      > > >>>>>>>>>>
      > > > object
      > > >
      > > >>>>> has the
      > > >>>>>
      > > >>>>>>>>>> feed url saved so we can just check that instead of the
      > > >>>>>>>>>>
      > > > domain.
      > > >
      > > >>>>> Duh.
      > > >>>>>
      > > >>>>>>>>>> Here's some demo code:
      > > >>>>>>>>>>
      > > >>>>>>>>>> <?php
      > > >>>>>>>>>> require_once 'simplepie.inc' ;
      > > >>>>>>>>>> $urls = array(
      > > >>>>>>>>>> 'http://digg. com/rss/index. xml'=>'diggicon. gif',
      > > >>>>>>>>>> 'http://www.techmeme .com/index. xml'=>'techmemeicon. gif'
      > > >>>>>>>>>> );
      > > >>>>>>>>>> $feed = new SimplePie();
      > > >>>>>>>>>> $keys = array_keys($ urls);
      > > >>>>>>>>>> $feed->set_feed_ url($keys) ;
      > > >>>>>>>>>> $feed->init( );
      > > >>>>>>>>>> foreach($feed- >get_items( ) as $item)
      > > >>>>>>>>>> {
      > > >>>>>>>>>> $f = $item->get_feed( );
      > > >>>>>>>>>> $url = $f->feed_url;
      > > >>>>>>>>>> $icon = $urls[$url];
      > > >>>>>>>>>> echo 'feedurl=',$ url;
      > > >>>>>>>>>> echo '<br>';
      > > >>>>>>>>>> echo 'icon=',$icon;
      > > >>>>>>>>>> echo '<br>';
      > > >>>>>>>>>> echo '<br>';
      > > >>>>>>>>>> }
      > > >>>>>>>>>> ?>
      > > >>>>>>>>>>
      > > >>>>>>>>>>
      > > >>>>>>>>>> Michael P. Shipley
      > > >>>>>>>>>> www.michaelpshipley .com <http://www.michaelp shipley.com>
      > > >>>>>>>>>>
      > > >>>>>>>>>>
      > > >>>>>>>>>> Gabriel wrote:
      > > >>>>>>>>>>
      > > >>>>>>>>>>
      > > >>>>>>>>>>> Hm, once I get the multifeeds cached I'm going to want to
      > > >>>>>>>>>>>
      > > >>>>> implement
      > > >>>>>
      > > >>>>>>>>>>> this as well... but there are a few feeds that use
      > feedburner
      > > >>>>>>>>>>>
      > > >>>>> so not
      > > >>>>>
      > > >>>>>>>>>>> all domains are unique.
      > > >>>>>>>>>>>
      > > >>>>>>>>>>> I think feedburner is the only domain that is
      redundant and
      > > >>>>>>>>>>>
      > > >>>>> its feed
      > > >>>>>
      > > >>>>>>>>>>> urls are a consistent format, so is it possible to do a
      > > >>>>>>>>>>>
      > > >>>>> conditional to
      > > >>>>>
      > > >>>>>>>>>>> set the key to the domain unless the domain is
      feedburner in
      > > >>>>>>>>>>>
      > > >>>> which
      > > >>>>
      > > >>>>>>>>>>> case it sets the key to the feedname
      > > >>>>>>>>>>>
      > > >>>>> (feeds.feedburner. com/feedname) ?
      > > >>>>>
      > > >>>>>>>>>>> I'm not very familiar with this stuff but can muddle
      my way
      > > >>>>>>>>>>>
      > > >>>>> through
      > > >>>>>
      > > >>>>>>>>>>> (looks like I wan't to use parse_url [path], and
      extract the
      > > >>>>>>>>>>>
      > > >>>>> part I
      > > >>>>>
      > > >>>>>>>>>>> want with a regex match?)... so any help in how to
      format a
      > > >>>>>>>>>>> conditional for this (or another solution entirely) is
      > > >>>>>>>>>>>
      > > > greatly
      > > >
      > > >>>>>>>>>>> appreciated!
      > > >>>>>>>>>>>
      > > >>>>>>>>>>> Thanks,
      > > >>>>>>>>>>> Gabe
      > > >>>>>>>>>>>
      > > >>>>>>>>>>> --- In simplepie-support@ yahoogroups. com, Michael Shipley
      > > >>>>>>>>>>> <michael@> wrote:
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>> Here's some code to show how you could do it. The
      > > >>>>>>>>>>>>
      > > > weakness of
      > > >
      > > >>>>> this
      > > >>>>>
      > > >>>>>>>>>>>> method is all the feed link domains must be unique
      since it
      > > >>>>>>>>>>>>
      > > >>>>> uses the
      > > >>>>>
      > > >>>>>>>>>>>> feed link domain name as keys.
      > > >>>>>>>>>>>>
      > > >>>>>>>>>>>> http://simplepie. pastebin. com/f5608cedc
      > > >>>>>>>>>>>>
      > > >>>>>>>>>>>> - Mike
      > > >>>>>>>>>>>>
      > > >>>>>>>>>>>> beatific1 wrote:
      > > >>>>>>>>>>>>
      > > >>>>>>>>>>>>
      > > >>>>>>>>>>>>
      > > >>>>>>>>>>>> > Hi,
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > we using Multifeeds and it works fine.
      > > >>>>>>>>>>>> > So, the script displays 6-7 different feeds, but we
      > want to
      > > >>>>>>>>>>>> >
      > > >>>>> have a
      > > >>>>>
      > > >>>>>>>>>>>> > clear arrangement with icons, but not favicons.
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > <?php
      > > >>>>>>>>>>>> > require_once( 'php/simplepie. inc');
      > > >>>>>>>>>>>> > $feed = new SimplePie(array(
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > 'http://www.wiiwelt. com/category/ reviews/feed' ,
      > > >>>>>>>>>>>> > 'http://www.ndswelt. com/category/ reviews/feed',
      > > >>>>>>>>>>>> > 'http://www.pspwelt. com/category/ reviews/feed',
      > > >>>>>>>>>>>> > ...
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > Is it possible, that we can use for every feed a
      different
      > > >>>>>>>>>>>> >
      > > >>>> icon?
      > > >>>>
      > > >>>>>>>>>>>> > I hope you understand me :-) .
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > thanks
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > ------------ --------- --------- ------
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> > Yahoo! Groups Links
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>>> >
      > > >>>>>>>>>>> ------------ --------- --------- ------
      > > >>>>>>>>>>>
      > > >>>>>>>>>>> Yahoo! Groups Links
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>>>
      > > >>>>>>>>>
      > > >>>>>>>>> ------------ --------- --------- ------
      > > >>>>>>>>>
      > > >>>>>>>>> Yahoo! Groups Links
      > > >>>>>>>>>
      > > >>>>>>>>>
      > > >>>>>>>>>
      > > >>>>>>>>>
      > > >>>>>>>>>
      > > >>>>>>>>>
      > > >>>>
      > > >>>> ------------ --------- --------- ------
      > > >>>>
      > > >>>> Yahoo! Groups Links
      > > >>>>
      > > >>>>
      > > >>>>
      > > >>>>
      > > >>> --
      > > >>> Ryan Parman
      > > >>> <http://ryanparman. com>
      > > >>>
      > > >>>
      > > >
      > > >
      > > >
      > > > ------------ --------- --------- ------
      > > >
      > > > Yahoo! Groups Links
      > > >
      > > >
      > > >
      > > >
      > > >
      > >
      >

    • osieak
      Gabe, I really like how you can state an img/ico for each feed in the array. But, would you happen to know of a way to give each feed it s own style? eg: I d
      Message 2 of 30 , Aug 28, 2008
      View Source
      • 0 Attachment
        Gabe, I really like how you can state an img/ico for each feed in the
        array. But, would you happen to know of a way to give each feed it's
        own style?

        eg: I'd like to group feeds of similar topic by color.

        'http://site1.com/some.rss' => 'blue',
        'http://site2.com/some.rss' => 'red',
        'http://site3.com/some.rss' => 'green',




        --- In simplepie-support@yahoogroups.com, "osieak" <osieak@...> wrote:
        >
        > Gabriel, thanks! Your example doesn't seem to suffer from the issue I
        > encountered. Got this working in minutes with a few little layout
        > changes. Thanks. Nice site btw.
        >
        >
        > --- In simplepie-support@yahoogroups.com, "Gabriel" <yahoo@> wrote:
        > >
        > > For reference, here is the full code I'm using for the page with the
        > > multifeed + matched custom icons. This link will be good for 6 months:
        > >
        > > http://pastebin.ca/1181386
        > >
        > > set_item_limit() works as expected for me, 30 distinct feeds in the
        > > multifeed and the limit tested up to 10 per feed. I have a test page
        > > that uses the code linked above with the exception that it dumps all
        > > the feeds and has a 10 per limit, feel free to take a look here:
        > >
        > > http://www.trueventures.com/feedtest -- sorting of the multiple feeds
        > > appears fine to me.
        > >
        > > Hope this helps,
        > > Gabe
        > >
        > > --- In simplepie-support@yahoogroups.com, Michael Shipley
        > > <michael@> wrote:
        > > >
        > > > Oh that stupid pastebin! This is strange. What are the feeds so
        I can
        > > > check them.
        > > >
        > > > Michael P. Shipley
        > > > www.michaelpshipley.com <http://www.michaelpshipley.com>
        > > >
        > > >
        > > > osieak wrote:
        > > > > So I've done a little more testing and here's what I've found.
        > > > >
        > > > > By including $feed->set_item_limit(4); all seems to work
        properly by
        > > > > sorting stories by pudDate in ascending order.
        > > > >
        > > > > Example:
        > > > >
        > > > > Story 08/21/08 6pm car.com
        > > > > Story 08/21/08 5pm car.com
        > > > > Story 08/21/08 4pm bus.com
        > > > > Story 08/21/08 3pm train.com
        > > > > Story 08/21/08 2pm boat.com
        > > > > Story 08/21/08 1pm bike.com
        > > > > Story 08/20/08 9pm car.com
        > > > > Story 08/20/08 6pm bus.com
        > > > > Story 08/20/08 3pm train.com
        > > > > Story 08/20/08 1pm boat.com
        > > > > ..
        > > > >
        > > > > However, when setting an item limit greater than 4, this is
        > where the
        > > > > grouping of stories occurs. Stories will now only be sorted,
        but in
        > > > > groups from originating source.
        > > > >
        > > > > Example:
        > > > >
        > > > > Story 08/21/08 6pm car.com
        > > > > Story 08/21/08 5pm car.com
        > > > > Story 08/21/08 4pm car.com
        > > > > Story 08/21/08 3pm car.com
        > > > > Story 08/21/08 2pm car.com
        > > > > Story 08/21/08 1pm car.com
        > > > > Story 08/21/08 5pm bus.com
        > > > > Story 08/21/08 4pm bus.com
        > > > > Story 08/21/08 3pm bus.com
        > > > > Story 08/21/08 2pm bus.com
        > > > > ..
        > > > >
        > > > >
        > > > > What I'm trying to do is aggregate multipliable feeds (20+) on
        > to one
        > > > > page with the following restraints.
        > > > >
        > > > > - Only show 100 stories in total.
        > > > > - Stories are sorted by pubDate, ascending newest to oldest.
        > > > > - Do not let the most active feeds dominate total,
        set_item_limit(8)
        > > > >
        > > > > Optional
        > > > > - Show favicon in front of each story title from originating site.
        > > > >
        > > > >
        > > > > The pastepin included in this thread was deleted, would be cool if
        > > > > somebody had the example still.
        > > > >
        > > > >
        > > > >
        > > > > --- In simplepie-support@yahoogroups.com, "osieak" <osieak@>
        wrote:
        > > > >
        > > > >> Yes sir, all feeds have the pubDate. :)
        > > > >>
        > > > >> --- In simplepie-support@yahoogroups.com, Ryan Parman
        > > > >> <simplepie.support@> wrote:
        > > > >>
        > > > >>> Have you seen
        > > > >>>
        > > > > http://simplepie.org/wiki/faq/typical_multifeed_gotchas ?
        > > > >
        > > > >>>
        > > > >>>
        > > > >>>
        > > > >>> On Aug 20, 2008, at 1:06 PM, osieak wrote:
        > > > >>>
        > > > >>>
        > > > >>>> Unfortunately the pastebin related to this has been removed,
        > > > >>>>
        > > > > otherwise
        > > > >
        > > > >>>> it sounds exactly like something I could use. Mike, would you
        > > happen
        > > > >>>> to this suggestion laying around still? I'm currently playing
        > > > >>>>
        > > > > with the
        > > > >
        > > > >>>> 'sort multifeeds by time and date' tutorial, everything seems
        > to be
        > > > >>>> working except the stories are all grouped together by
        > source. I'd
        > > > >>>> like them based on date published. Any help?
        > > > >>>>
        > > > >>>> Link to the code I'm playing with:
        > > > >>>> http://simplepie.org/wiki/tutorial/
        > > > >>>> sort_multiple_feeds_by_time_and_date
        > > > >>>>
        > > > >>>>
        > > > >>>> --- In simplepie-support@yahoogroups.com, "Gabriel" <yahoo@>
        > wrote:
        > > > >>>>
        > > > >>>>> Awesome, you rock. I love explosions and implosions! I now
        have
        > > > >>>>> everything working with SP Core using caching (using a
        > separately
        > > > >>>>> called file to populate the cache) and icons matched per
        > feed :)
        > > > >>>>>
        > > > >>>>> Here is the resultant cobbled together code (this isn't
        live so
        > > > >>>>> prelaunch sensitive company path/urls made generic):
        > > > >>>>>
        > > > >>>>> http://simplepie.pastebin.com/m7af35ed5
        > > > >>>>>
        > > > >>>>> There is one lingering issue that I almost didn't catch
        that I'm
        > > > >>>>> hoping you can help me with. The output is being sorted in the
        > > > >>>>>
        > > > > order
        > > > >
        > > > >>>>> of the feeds in the array, not by item date. So it's
        > returning the
        > > > >>>>> latest post of the 1st N (8 in the pastebin code above) feeds
        > > > >>>>>
        > > > > in the
        > > > >
        > > > >>>>> array as the N items output. What I'm looking to accomplish
        > is the
        > > > >>>>> output of the latest N items out of all the combined items
        > > > >>>>>
        > > > > across all
        > > > >
        > > > >>>>> feeds. Hopefully that makes sense.
        > > > >>>>>
        > > > >>>>> Please point me in the right direction, I think perhaps I'm
        > > > >>>>> misunderstanding what stage the enable_order_by_date has an
        > > > >>>>>
        > > > > effect
        > > > >
        > > > >>>>> on?
        > > > >>>>> Upon closer examination it looks like it ensures that the
        items
        > > > >>>>>
        > > > > in a
        > > > >
        > > > >>>>> given feed are sorted by date, not that all the pulled in
        items
        > > > >>>>>
        > > > > from
        > > > >
        > > > >>>>> all feeds are mixed and sorted.
        > > > >>>>>
        > > > >>>>> Thanks again (so much!) for all the help, Padawan-O-Some-Pie!
        > > > >>>>>
        > > > >>>>> Gabe
        > > > >>>>>
        > > > >>>>> --- In simplepie-support@yahoogroups.com, Michael Shipley
        > > > >>>>> <michael@> wrote:
        > > > >>>>>
        > > > >>>>>> To limit total items returned, just call the "get_items"
        > function
        > > > >>>>>>
        > > > >>>> with
        > > > >>>>
        > > > >>>>>> two parameters. The first parameter is the item you want to
        > start
        > > > >>>>>>
        > > > >>>> with,
        > > > >>>>
        > > > >>>>>> the second is the number of items you want returned.
        > > > >>>>>>
        > > > >>>>>> For instance, to start at item 0 and return a total of 10
        > > > >>>>>>
        > > > > items, you
        > > > >
        > > > >>>>>> would do this:
        > > > >>>>>>
        > > > >>>>>> foreach($feed->get_items(0,10) as $item)
        > > > >>>>>> {
        > > > >>>>>> echo $item->get_title();
        > > > >>>>>> // etc...
        > > > >>>>>> }
        > > > >>>>>>
        > > > >>>>>> There is no equivalent item description truncate function
        in SP
        > > > >>>>>>
        > > > >>>>> classic.
        > > > >>>>>
        > > > >>>>>> You could do something very simple like:
        > > > >>>>>>
        > > > >>>>>> $truncDesc =
        > substr(strip_tags($item->get_description()),0,50) +
        > > > >>>>>>
        > > > >>>> '...';
        > > > >>>>
        > > > >>>>>> Or you could use this much cooler,
        > > > >>>>>> "smart-truncate-by-number-of-characters", function that the
        > > > >>>>>> "Masta-O-Da-Pie", Mr. Ryan Parman, whipped up:
        > > > >>>>>>
        > > > >>>>>>
        > > http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions
        > > > >>>>>>
        > > > >>>>>> Or you could use a much more cooler-er,
        > > > >>>>>> "genius-level-truncate-by-number-of-words" function that the
        > > > >>>>>> "Padawan-O-Some-Pie", Michael Shipley, laid down. You'll
        > like it
        > > > >>>>>> because there's lots of stuff exploding and imploding. ;-)
        > > > >>>>>>
        > > > >>>>>> http://simplepie.pastebin.com/f5c3b288b
        > > > >>>>>>
        > > > >>>>>> Michael P. Shipley
        > > > >>>>>> www.michaelpshipley.com <http://www.michaelpshipley.com>
        > > > >>>>>>
        > > > >>>>>>
        > > > >>>>>> Gabriel Crow wrote:
        > > > >>>>>>
        > > > >>>>>>> Thanks Mike, that's about what I expected. I'll switch
        my code
        > > > >>>>>>>
        > > > >>>>> over to
        > > > >>>>>
        > > > >>>>>>> SP Core and get it working first, then perhaps try my
        hand at
        > > > >>>>>>> extending the class. I've looked through the API for SP Core
        > > > >>>>>>>
        > > > > and it
        > > > >
        > > > >>>>>>> looks straightforward enough, just one question there...
        using
        > > > >>>>>>>
        > > > >>>> SPWP I
        > > > >>>>
        > > > >>>>>>> can limit the number of items per input feed as well as the
        > > > >>>>>>>
        > > > >>>> number of
        > > > >>>>
        > > > >>>>>>> items to output from the multifeed. I see the limit
        items per
        > > > >>>>>>>
        > > > >>>> feed in
        > > > >>>>
        > > > >>>>>>> SP Core but I don't see anything for limiting the output. Is
        > > > >>>>>>>
        > > > > there
        > > > >
        > > > >>>>>>> something I'm missing or do I just need to make a function
        > > > >>>>>>>
        > > > >>>> myself to
        > > > >>>>
        > > > >>>>>>> limit it? Same question for truncating text.
        > > > >>>>>>>
        > > > >>>>>>> If I do need to make functions for these can you tell me
        > around
        > > > >>>>>>>
        > > > >>>> what
        > > > >>>>
        > > > >>>>>>> lines of SPWP source I can look to for reference? I'm
        thinking
        > > > >>>>>>>
        > > > >>>> for my
        > > > >>>>
        > > > >>>>>>> skill level it will be easiest to extend SP Core with
        just the
        > > > >>>>>>> modified/extracted bits of SPWP that I will use + any bits
        > > > >>>>>>>
        > > > >>>>> relevant to
        > > > >>>>>
        > > > >>>>>>> the icons and caching.
        > > > >>>>>>> Sound about right?
        > > > >>>>>>>
        > > > >>>>>>> Michael Shipley wrote:
        > > > >>>>>>>
        > > > >>>>>>>> As far as I know you'd have to revert to standard SimplePie
        > > (aka
        > > > >>>>>>>> SimplePie Core) in order to use this technique since this
        > is a
        > > > >>>>>>>>
        > > > >>>>> custom
        > > > >>>>>
        > > > >>>>>>>> solution beyond the abilities of SPWP.
        > > > >>>>>>>>
        > > > >>>>>>>> Your right, autodiscovery would present a problem since the
        > > > >>>>>>>>
        > > > >>>> feed_url
        > > > >>>>
        > > > >>>>>>>> variable would change. For this to work you would need to
        > > > >>>>>>>>
        > > > > use the
        > > > >
        > > > >>>>>>>> actual feed url. Or, you could extend the standard
        SimplePie
        > > > >>>>>>>>
        > > > > class
        > > > >
        > > > >>>>>>>> and add code to save the initial url to "saved_feed_url"
        > > and use
        > > > >>>>>>>>
        > > > >>>>> that
        > > > >>>>>
        > > > >>>>>>>> variable instead but that would be a non trivial task and
        > > > >>>>>>>>
        > > > >>>> definitely
        > > > >>>>
        > > > >>>>>>>> beyond the scope of SPWP.
        > > > >>>>>>>>
        > > > >>>>>>>>
        > > > >>>>>>>> Michael P. Shipley
        > > > >>>>>>>> www.michaelpshipley.com <http://www.michaelpshipley.com>
        > > > >>>>>>>>
        > > > >>>>>>>>
        > > > >>>>>>>> Gabriel wrote:
        > > > >>>>>>>>
        > > > >>>>>>>>> Cool, makes sense. I assume then that I need to make
        sure my
        > > > >>>>>>>>>
        > > > >>>>> array has
        > > > >>>>>
        > > > >>>>>>>>> the full source feed url and not leave anything up to
        > > > >>>>>>>>>
        > > > >>>>> 'autodiscovery'.
        > > > >>>>>
        > > > >>>>>>>>> I prefer the real feed vs autodiscovery anyway, but
        I'm not
        > > > >>>>>>>>>
        > > > >>>> going to
        > > > >>>>
        > > > >>>>>>>>> be managing the list of feeds -- ideally I'll set it up to
        > > pull
        > > > >>>>>>>>>
        > > > >>>>> out of
        > > > >>>>>
        > > > >>>>>>>>> Wordpress links within a specified category to make it
        easy
        > > > >>>>>>>>>
        > > > >>>> for the
        > > > >>>>
        > > > >>>>>>>>> non technically inclined to manage... but that's another
        > day.
        > > > >>>>>>>>>
        > > > >>>>>>>>> I'm using SimplePieWP... how best to handle the
        > > > >>>>>>>>>
        > > > >>>> output/formatting of
        > > > >>>>
        > > > >>>>>>>>> this? I assume the SimplePieWP templates don't parse
        PHP.
        > > > >>>>>>>>> Should I
        > > > >>>>>>>>> rework everything to SimplePie Core, or is there a way
        > to tell
        > > > >>>>>>>>>
        > > > >>>>> SPWP to
        > > > >>>>>
        > > > >>>>>>>>> ignore the template and use the API tags?
        > > > >>>>>>>>>
        > > > >>>>>>>>> Thanks again for all the pointers,
        > > > >>>>>>>>> Gabe
        > > > >>>>>>>>>
        > > > >>>>>>>>> --- In simplepie-support@yahoogroups.com, Michael Shipley
        > > > >>>>>>>>> <michael@> wrote:
        > > > >>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>>>>>>> Actually I thought of a better way to do this. Each feed
        > > > >>>>>>>>>>
        > > > > object
        > > > >
        > > > >>>>> has the
        > > > >>>>>
        > > > >>>>>>>>>> feed url saved so we can just check that instead of the
        > > > >>>>>>>>>>
        > > > > domain.
        > > > >
        > > > >>>>> Duh.
        > > > >>>>>
        > > > >>>>>>>>>> Here's some demo code:
        > > > >>>>>>>>>>
        > > > >>>>>>>>>> <?php
        > > > >>>>>>>>>> require_once 'simplepie.inc';
        > > > >>>>>>>>>> $urls = array(
        > > > >>>>>>>>>> 'http://digg.com/rss/index.xml'=>'diggicon.gif',
        > > > >>>>>>>>>>
        'http://www.techmeme.com/index.xml'=>'techmemeicon.gif'
        > > > >>>>>>>>>> );
        > > > >>>>>>>>>> $feed = new SimplePie();
        > > > >>>>>>>>>> $keys = array_keys($urls);
        > > > >>>>>>>>>> $feed->set_feed_url($keys);
        > > > >>>>>>>>>> $feed->init();
        > > > >>>>>>>>>> foreach($feed->get_items() as $item)
        > > > >>>>>>>>>> {
        > > > >>>>>>>>>> $f = $item->get_feed();
        > > > >>>>>>>>>> $url = $f->feed_url;
        > > > >>>>>>>>>> $icon = $urls[$url];
        > > > >>>>>>>>>> echo 'feedurl=',$url;
        > > > >>>>>>>>>> echo '<br>';
        > > > >>>>>>>>>> echo 'icon=',$icon;
        > > > >>>>>>>>>> echo '<br>';
        > > > >>>>>>>>>> echo '<br>';
        > > > >>>>>>>>>> }
        > > > >>>>>>>>>> ?>
        > > > >>>>>>>>>>
        > > > >>>>>>>>>>
        > > > >>>>>>>>>> Michael P. Shipley
        > > > >>>>>>>>>> www.michaelpshipley.com <http://www.michaelpshipley.com>
        > > > >>>>>>>>>>
        > > > >>>>>>>>>>
        > > > >>>>>>>>>> Gabriel wrote:
        > > > >>>>>>>>>>
        > > > >>>>>>>>>>
        > > > >>>>>>>>>>> Hm, once I get the multifeeds cached I'm going to
        want to
        > > > >>>>>>>>>>>
        > > > >>>>> implement
        > > > >>>>>
        > > > >>>>>>>>>>> this as well... but there are a few feeds that use
        > > feedburner
        > > > >>>>>>>>>>>
        > > > >>>>> so not
        > > > >>>>>
        > > > >>>>>>>>>>> all domains are unique.
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>> I think feedburner is the only domain that is
        > redundant and
        > > > >>>>>>>>>>>
        > > > >>>>> its feed
        > > > >>>>>
        > > > >>>>>>>>>>> urls are a consistent format, so is it possible to do a
        > > > >>>>>>>>>>>
        > > > >>>>> conditional to
        > > > >>>>>
        > > > >>>>>>>>>>> set the key to the domain unless the domain is
        > feedburner in
        > > > >>>>>>>>>>>
        > > > >>>> which
        > > > >>>>
        > > > >>>>>>>>>>> case it sets the key to the feedname
        > > > >>>>>>>>>>>
        > > > >>>>> (feeds.feedburner.com/feedname)?
        > > > >>>>>
        > > > >>>>>>>>>>> I'm not very familiar with this stuff but can muddle
        > my way
        > > > >>>>>>>>>>>
        > > > >>>>> through
        > > > >>>>>
        > > > >>>>>>>>>>> (looks like I wan't to use parse_url [path], and
        > extract the
        > > > >>>>>>>>>>>
        > > > >>>>> part I
        > > > >>>>>
        > > > >>>>>>>>>>> want with a regex match?)... so any help in how to
        > format a
        > > > >>>>>>>>>>> conditional for this (or another solution entirely) is
        > > > >>>>>>>>>>>
        > > > > greatly
        > > > >
        > > > >>>>>>>>>>> appreciated!
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>> Thanks,
        > > > >>>>>>>>>>> Gabe
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>> --- In simplepie-support@yahoogroups.com, Michael
        Shipley
        > > > >>>>>>>>>>> <michael@> wrote:
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>> Here's some code to show how you could do it. The
        > > > >>>>>>>>>>>>
        > > > > weakness of
        > > > >
        > > > >>>>> this
        > > > >>>>>
        > > > >>>>>>>>>>>> method is all the feed link domains must be unique
        > since it
        > > > >>>>>>>>>>>>
        > > > >>>>> uses the
        > > > >>>>>
        > > > >>>>>>>>>>>> feed link domain name as keys.
        > > > >>>>>>>>>>>>
        > > > >>>>>>>>>>>> http://simplepie.pastebin.com/f5608cedc
        > > > >>>>>>>>>>>>
        > > > >>>>>>>>>>>> - Mike
        > > > >>>>>>>>>>>>
        > > > >>>>>>>>>>>> beatific1 wrote:
        > > > >>>>>>>>>>>>
        > > > >>>>>>>>>>>>
        > > > >>>>>>>>>>>>
        > > > >>>>>>>>>>>>> Hi,
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> we using Multifeeds and it works fine.
        > > > >>>>>>>>>>>>> So, the script displays 6-7 different feeds, but we
        > > want to
        > > > >>>>>>>>>>>>>
        > > > >>>>> have a
        > > > >>>>>
        > > > >>>>>>>>>>>>> clear arrangement with icons, but not favicons.
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> <?php
        > > > >>>>>>>>>>>>> require_once('php/simplepie.inc');
        > > > >>>>>>>>>>>>> $feed = new SimplePie(array(
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> 'http://www.wiiwelt.com/category/reviews/feed' ,
        > > > >>>>>>>>>>>>> 'http://www.ndswelt.com/category/reviews/feed',
        > > > >>>>>>>>>>>>> 'http://www.pspwelt.com/category/reviews/feed',
        > > > >>>>>>>>>>>>> ...
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> Is it possible, that we can use for every feed a
        > different
        > > > >>>>>>>>>>>>>
        > > > >>>> icon?
        > > > >>>>
        > > > >>>>>>>>>>>>> I hope you understand me :-) .
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> thanks
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> ------------------------------------
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>> Yahoo! Groups Links
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>>>>
        > > > >>>>>>>>>>> ------------------------------------
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>> Yahoo! Groups Links
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>>>>>> ------------------------------------
        > > > >>>>>>>>>
        > > > >>>>>>>>> Yahoo! Groups Links
        > > > >>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>>>>>>
        > > > >>>>
        > > > >>>> ------------------------------------
        > > > >>>>
        > > > >>>> Yahoo! Groups Links
        > > > >>>>
        > > > >>>>
        > > > >>>>
        > > > >>>>
        > > > >>> --
        > > > >>> Ryan Parman
        > > > >>> <http://ryanparman.com>
        > > > >>>
        > > > >>>
        > > > >
        > > > >
        > > > >
        > > > > ------------------------------------
        > > > >
        > > > > Yahoo! Groups Links
        > > > >
        > > > >
        > > > >
        > > > >
        > > > >
        > > >
        > >
        >
      • ascdbm44
        Thanks for the all the code here. Have now got multifeeds working well with icons. Is it possible to have icons for multifeeds whilst using a flat file
        Message 3 of 30 , Jun 3, 2009
        View Source
        • 0 Attachment
          Thanks for the all the code here. Have now got multifeeds working well with icons.

          Is it possible to have icons for multifeeds whilst using a flat file database as in the code sample described here ?

          http://simplepie.org/wiki/tutorial/how_to_display_previous_feed_items_like_google_reader


          --- In simplepie-support@yahoogroups.com, "beatific1" <beatific1@...> wrote:
          >
          > Thank you for your fast reply and the code!
          >
          > I've spend hours and hours to solve this problems, but it won't succeed.
          > There are no icons and no links to the feed source. I hope you help me
          > again. My head is aching a lot ;-) . My code is now:
          >
          > <?php
          > $icons = array
          > (
          >
          > 'http://www.wiiwelt.com/feed'=>'http://gamingwelt.com/images/wii.gif',
          >
          > 'http://www.ndswelt.com/feed'=>'http://gamingwelt.com/images/nds.gif',
          >
          > 'http://www.pspwelt.com/feed'=>'http://gamingwelt.com/images/psp.gif',
          > );
          > include 'php/simplepie.inc';
          > $feed = new
          > SimplePie(array('http://www.wiiwelt.com/feed','http://www.ndswelt.com/feed','http://www.pspwelt.com/feed'));
          > ?>
          >
          > <?php
          > foreach($feed->get_items() as $item)
          > {
          > $feed = $item->get_feed();
          > $feedLink = $feed->get_link();
          > $parsed= parse_url($feedLink);
          > $host = $parsed[''];
          > $icon = '';
          > if(isset($icons[$host]))
          > {
          > $icon = $icons[$host];
          > }
          > echo '<p>';
          > echo '<img src="', $icon , '" />';
          > echo $item->get_title(); get_permalink();
          > echo '</p>';
          > }
          > ?>
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.