PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm quite new to the whole RSS/XML thing, but I am trying to set up an RSS feed on my website. I am using Magpie to create the RSS links - but what I would like is for the content of those links to appear within my website framework too. Generally, I'd like the content that the RSS feed is linking to, to look like it is contained within my site.
Could anyone point me in the right direction? I am finding it hard to find explainations on how to achieve this, although I have found several sites where this appears to be happening.
RSS feeds correspond to the content on your website, not the other way around. Every other website that uses RSS feeds is set up in a manner where they have updated content on the website and, every time that it's updated, the RSS feed contains the last 10-15 entries, and everything else is archived.
So the RSS feed is something I would broadcast from my site reflecting it's content. So, how would I go about retrieving another sites broadcast feed and making it's content appear as content on my site? Or is that not what RSS is about at all? What method would I need to investigate?
RSS is just XML, so you could just write an XSL transform and render the data any way you want with XSLT. This assumes that your PHP server configuration allows XSL. You can make it available by uncommenting "extension=php_xsl.dll" in your php.ini, or request it activated from your ISP. Take a look at my example here:
That's not was RSS is about at all. However, you can do that to an extent.
What you want to do is retrieve their feed and parse the XML to retrieve the titles and the links. You can also get the other elements (date, description/teaser, etc.), but they aren't essential. Then, you list them out, usually arranged by date. If you plan to archive them, you may want them to be automatically saved to the database since RSS feeds typically don't have too large of on amount of updated content on them. Just the latest.
What you don't want to do is actually take their content. That's oftentimes copyright infringement and doing so can get you in a lot of legal trouble. Developers put a lot of time into their content and won't take kindly to you stealing from them.
Superdezign, the RSS you describe I can create. A XML parser that allows me to create a page of up-to-date links to the originators website. I understand the legal implications of transfering content - but if you have that sites permission, surely that is then not a problem.
So in the same way as parsing the original RSS from the XML file, would the content be parsed in the same way using content/image tags in the XML file? If that's the case, I can ask that this is added in the originators file - and away we go.