Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RSS Feeds from Multiple Servers/Sites

Status
Not open for further replies.

QuinnMal

Technical User
Jul 10, 2006
2
0
0
US
Hey all. I just started a new project with RSS and would really appreciate any advice/help/knowledge. I have had no experience with RSS prior to this, however I'm fluent in Javascript and other languages, just have never done anything RSS related before.

My department has a department website that's broken down into several sections, lets say
1. Publications
2. Projects
3. Research

So on each of those webpages (Publications, Projects, Research) we want an RSS feed for that section. As in on the Publications.html page, only the publications rss feed is displayed.

Now where the RSS feed gets it information from is more tricky.

Each project in our department has their own website/own server/own publications and own Project-specific RSS feed.

I'm trying to figure out a way so that I can have a system so that people can make their own rss on their own websites, (incase they wanted their own rss feed on their site) but I then want the Department Webpages above to pull the rss feeds from these other xml files.

so if I have 2 projects: say Project Mongoose and Project Zebra. Each project is on their own website/server ( and I want to find a way so that there can be a publications.xml, projects.xml, research.xml on each of those servers and then I want a way so when I go to it displays the rss information from BOTH the publications.xml file on Project Mongoose's server AND the publications.xml file from the Project Zebra file.

I'm sorry for the long post and confusion, but I would seriously appreciate any help. So to break it down, I need to figure out a way to:
1. Have instructions for people on their own servers to create RSS files (pubs.xml, projects.xml, research.xml)
2. I need to somehow write an RSS feed for the Webpages that will have a static list of servers and will Pull the 3 rss feeds from each listed server.
3. Display the feeds on their respective pages. (/publications.html would show the feeds from both publications.xml files)

If anyone has ANY ideas on how to accomplish this, please let me know. Thank you so much.
 
1. Update department.xml by modifying department and article information enclosed within <brackets>.
<?xml version="1.0" encoding="Windows-1252" ?>
- <rss version="2.0">
- <channel>
<language>en</language>
<pubDate>8 Sep 2007 23:04:19 GMT</pubDate>
<title>department title</title>
<link>department home page</link>
<description>department description</description>
- <item>
<title>article title</title>
<link>article link</link>
<guid>article link</guid>
<description>article description</description>
</item>
- <item>
</channel>
</rss>
If the addresses were on the internet you could use rssinclude. See as an example. Sounds like this is an intranet so you might have to find/create your JavaScript, PHP, etc to ripple through the XML file and output HTML.

I just started toying around with it this past weekend. Hope this helps.
Mickey
 
You'll need to do some server-side coding to achieve this (you could do it with javascript but its harder/nastier). What do you know/run on your servers?

If you know how to do an XSL transform on the server you could do something like:

XML:
Code:
<rss_feeds>
  <projects>
    <project>
      <name>Mongoose</name>
      <url>[URL unfurl="true"]http://www.mongoose.com/projects.xml</url>[/URL]
    </project>
    <project>
      <name>Zebra</name>
      <url>[URL unfurl="true"]http://www.zebra.com/projects.xml</url>[/URL]
    </project>
  </projects>
</rss_feeds>
XSL:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
  <xsl:template match="/">
    <xsl:apply-templates select="rss_feeds/projects"/>
  </xsl:template>
  <xsl:template match="projects">
    <rss version="2.0">
      <channel>
        .....
        <xsl:apply-templates select="project"/>
      </channel>
    </rss>
  </xsl:template>
  <xsl:template match="project">
    <xsl:apply-templates select="document(url)//item">
      <xsl:with-param name="name" select="name"/>
      <xsl:with-param name="url" select="url"/>
    </xsl:apply-templates>
  </xsl:template>
  <xsl:template match="item">
    <xsl:param name="name"/>
    <xsl:param name="url"/>
    <item>
      <xsl:copy-of select="*"/>
      <category domain="{$url}"><xsl:value-of select="$name"/></category>
    </item>
  </xsl:template>
</xsl:stylesheet>

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top