Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Posting RSS Feed Content as HTML

Hey all,

Is there a good tutorial (video preferable) on how to post content from an rss feed on to a website with HTML. I'm particularly interested in being able to manipulate how much of each post shows up.

For instance, I want to take an RSS feed from a blog and post it on my site. I want the Title to show up and then a certain number of words, then end with ... and below that have something like "Continue Reading" with a link to the blog. Just in case I'm not making any sense (it's been a crappy day), I've typed an example below. Thanks you guys!

This is an example

i can't figure out how to do this, but I really want to...

Continue Reading

2 Answers

Presumably you would use javascript / jquery. If the rss feed is in xml you could use the google API to convert to JSON then just pull in the feed an iterate through as you desire creating the required amount of list items. If you checkout the BlogReader Videos on Team Treehouse for Android Application development it will explain everything but the xml to json part.

When you get to this line

URL blogFeedUrl = new URL("http://blog.teamtreehouse.com/api/get_recent_summary/?count=" + NUMBER_OF_POSTS);

you would be looking to change to this where the rss feed is added to the google conversion utils

http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=8&q=http%3A%2F%2Fwww.yourrssfeed.com%2Frss");

Thanks, I'll check it out.