By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

script for grabbing an xml rss feed file into my server as xml file too

P: n/a
How do I copy using a php or cgi script a remote xml rss feed into my
server?
I.E the rss feed:

http://www.lanacion.com.ar/herramien...x.asp?origen=2

Due to restrictions in flash player 7 I need to load a remote xml rss
feed.
I am using load.xml( http://www....

but in that way doesn´t work

The only way that works is when the rss xml feed is placed on my
server. I could upload manually the xml rss feed but I need a php
script to be called from flash and then parsed. What I need is the
script to make that remote xml being "local" to my flash movie.

Trying other stuff Ive found on forums about "proxy scripting" but
that only works if you are using flash player 6, flash player 7 even
don´t allow redirection scripts at all.

Hope anybody could help

Marcos
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 2004-12-28, ARGENTINA <sj****@yahoo.com> wrote:
The only way that works is when the rss xml feed is placed on my
server. I could upload manually the xml rss feed but I need a php
script to be called from flash and then parsed. What I need is the
script to make that remote xml being "local" to my flash movie.


place something like this on your server

<?php
// gateway.php
if (!isset($_GET['url'])) exit();
echo file_get_contents($_GET['url']);
?>

meaby you want to limit the allowed urls, throw in a default, add some
caching... i think the concept is clear.
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.info>
Jul 17 '05 #2

P: n/a
I use the following in my site for listing RSS Feeds to my homepage:
<?php
$rdffile = ($rdf_dir."slashdot.rdf");
$remote = "http://slashdot.org/slashdot.rdf";
$refreshtime = time() - 3600;

if ((filemtime($rdffile) < $refreshtime) ||
(filesize($rdffile) == 0)) {
$RDF = fopen( $rdffile, "w" ) or die(
"Cannot open $rdffile" );
$FILE = fopen( $remote, "r" ) or die(
"Cannot open $remote" );
while (!feof( $FILE )) {
fwrite( $RDF, fgets( $FILE, 1024 ));
}
fclose( $RDF );
fclose( $FILE );
}

?>

Of course, I use php to parse the feed, but this should help.
Basically, it checks to see if there is a recent copy of the xml file,
otherwise it updates it from the feedsite after 3600 seconds have
passed. This prevent spamming of the feed site.

Jul 17 '05 #3

P: n/a
Hi

I hope this code suits your needs..

http://www.manisharma.s4u.org/php_rss_reader.html

subbu
rchaplin wrote:
I use the following in my site for listing RSS Feeds to my homepage:
<?php
$rdffile = ($rdf_dir."slashdot.rdf");
$remote = "http://slashdot.org/slashdot.rdf";
$refreshtime = time() - 3600;

if ((filemtime($rdffile) < $refreshtime) ||
(filesize($rdffile) == 0)) {
$RDF = fopen( $rdffile, "w" ) or die(
"Cannot open $rdffile" );
$FILE = fopen( $remote, "r" ) or die(
"Cannot open $remote" );
while (!feof( $FILE )) {
fwrite( $RDF, fgets( $FILE, 1024 ));
}
fclose( $RDF );
fclose( $FILE );
}

?>

Of course, I use php to parse the feed, but this should help.
Basically, it checks to see if there is a recent copy of the xml file, otherwise it updates it from the feedsite after 3600 seconds have
passed. This prevent spamming of the feed site.


Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.