Forum Moderators: coopster

Message Too Old, No Replies

Displaying first 50 Words of RSS Feed

RSS Limiting

         

adrock31

9:08 pm on Jun 26, 2005 (gmt 0)

10+ Year Member



I want to display my personal blog on the homepage of my corporate site, but I want to limit it to the first 50 words (or three/four sentences; whichever is easier) so that my long posts don't take up the entirety of my corporate homepage. I'm using Movable Type as my blogging tool AND as my homepage for my corporate site, using reblog/refeed to repost my personal RSS feed onto the corporate site.

I'm not sure how to do this, but I figured that PHP could limit the RSS to 50 words, 4 sentences, or first <p> tag only and hide/not display the rest (as well as any accompanied images that would appear later in the post).

I also would like to link to other blog entries of friends that are interesting, but not post their entire blog, so it would be great if I could use it for that as well. This way, I'm linking to their stories, and not republishing their entire articles, all while not having to manually enter it everytime I want to link to a story.

I'm a total newby to PHP, so my first question is, is PHP the right tool to do this, and how do I go about accomplishing it?

Thanks
adrock31

Blackie

8:14 am on Jun 28, 2005 (gmt 0)

10+ Year Member



php is the right tool.

You can use fgets or file_get_contents functions available in php. Just make a search for these in you favorite SE and you should find plenty of examples.