5

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

1

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

Comments

1

something like this:

rss.php

<?php

    // enable php_xsl extension

    $xml = new DomDocument;
    $xml->load("http://www.gamestv.org/rss.php?type=news&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">

<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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.