Some feeds have more items than you need. If a news feed has twenty items, but you only want the five most recent articles, then this example can help.
First, we fetch the feed (in this case the Yahoo! World News feed). Since the feed may or may not be in any particular order, we pipe it through a Sort module, and sort on the item.y:published.utime element. (The utime element of any datetime data represents the date and time as the number of seconds that have elapsed since the beginning of the "epoch" - defined as jan 1, 1970.) By sorting in descending order, the most recent articles move to the top of the feed.
Then we just just pipe the output into a Truncate module. We wire a Number Input module into Truncate's value field to make it easy for the user to configure the number of fresh news items they want. The default is five items.
Pipe Web Address: http://pipes.yahoo.com/pipes_team/DjV8JOFS3BGg3vF_TqoASA