Re: RSS Feed creator/server
- I had the same basic problem, but I use ColdFusion. I was most interested
in developing my own reader that I could integrate into my websites. I
recent found a solution that I'm playing with. Maybe you can apply the
basic principles to your php tool?
1) Find the address of the rss feed you want to pull
2) Set that address as a variable (or set in an array of other addresses
that include other sites.
3) ColdFusion has a command, cfhttp -- which essentially tells the
ColdFusion server to go out to an address supplied (step 2) and "get"
(return) the content as a variable (cfhttp.fileContent).
3) It is necessary to use different functions to "clean up" the string --
the app I found uses a "trim" function and there is a function that parses
XML content: XMLParse(trim(cfhttp.fileContent))
4) Now you have an XML document that you can further parse and display.
Basically, the rss feed includes some basic information organized as the
"channel". And under the channel is a series of XML chunks called "items".
To display, use a form of dot notation that is familiar to most programmers.
For example, this displays the link of an image contained in an rss feed I
was interested in:
You get at the "items" by using some loop function as they are structured as
an array in XML
In ColdFusion, the code looks something like this:
<cfloop from="1" to="#ArrayLen(XMLContent.rss.channel.item)#" index="idx">
I would assume that you can duplicate many of these same functions in PHP or
some other language; hope this helps.
The Grant Connection