views:

47

answers:

2

I want to grab the RSS feed content from a site and display it in my website with different filtering options.

Can anyone put a php script which can grab the content from there and show

+2  A: 

SO is for asking specific questions related to programming. Even though your question is related to programming you are not asking a specific question.

A quick google search for "PHP read RSS feeds gives you a list of very good links which can get you started.

How to Read an RSS Feed With PHP – screencast

Try out the example and see if it fits your requirement. If you have any specific questions then come back to SO and I am sure everyone will be glad to help.

Shoban
looks far too cumbersome
f00
+1  A: 

something like this:

rss.php

<?php

    // enable php_xsl extension

    $xml = new DomDocument;
    $xml->load("http://www.gamestv.org/rss.php?type=news&amp;limit=8");

    $xsl = new DomDocument;
    $xsl->load("RSSFeed.xsl");

    $xp = new XsltProcessor();
    $xp->importStylesheet($xsl);
    if($html = $xp->transformToXML($xml)) echo $html;
?>

RSSFeed.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;

<xsl:template match="/rss/channel">
    <xsl:for-each select="/rss/channel/item">
        <div style="padding-bottom:10px; padding-top:10px;"><a>
            <xsl:attribute name="title"><xsl:value-of select="title"/></xsl:attribute>
            <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
            <xsl:value-of select="title"/>
        </a></div>
        <div><xsl:value-of disable-output-escaping="yes" select="description"/></div>
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>
f00