Showing the contents of an RSS feed with Junecode

Someone asked me recently if it’s possible to subscribe to an RSS feed from a Junecode site. The subscription feature, which adds entries from another site to your own, can only be used with other sites that use the same installation of Junecode. You can display entries from an RSS feed on your site though, using one of the included plug-ins. (It’s in code/sites/plugins/plugin.rss.php if you want to poke around at the code.)

Here’s a sample of how it works:

<ul>
<junecode:rssfeed url="http://example.com/feed.xml" count="8">
  <li><junecode:createlink href="{junecode:rsslink}" 
    text="{junecode:rsstitle htmlentities='true'}" decode="true" 
    emptytext="true" emptyspan="true" /></li>
</junecode:rssfeed>
</ul>

This would look for an RSS feed at http://example.com/feed.xml, and then display the titles of the first 8 entries in a list. If an entry included a URL, then the title would link to it. If you wanted to display the text of each entry as well, you could use the junecode:rsstext tag. You can use something like <junecode:rsstext excerpt="100" /> to display only the first 100 characters of the text, if you just want an excerpt.

Comments

This entry has no comments.

View more

Junecode

Using Junecode for a site that isn't a blog In reply to this entry, Nathan asked: Had to give this a [go]. Some really slick…

Introducing Junecode 3.0 (formerly Tense Code) After a year and a half of work, I’m excited to present the first beta of Junecode 3.0,…

Tense Code 3.0: a quick tutorial This entry is part of a series showing off the new features in Tense Code 3.0. Tense…

Tense Code 3.0: a new look and iPhone support This entry is part of a series showing off the new features in Tense Code 3.0. Tense…