473,468 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
3 2452
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Oliver Spiesshofer | last post by:
Hi, is there a script out there that can send RSS feeds to a given email account? I have search the usual suspects (google, SF, FM, hotscripts) but could not find anything thanks Oliver
6
by: S P Arif Sahari Wibowo | last post by:
Hi! I am thinking to have a client-side script doing processing on file downloading, basically the script will process a downloaded file from the server before it received by the user. For...
6
by: Lex Hider | last post by:
Hi, Apologies if this is against etiquette. I've just got my first python app up and running. It is a podcast aggregator depending on feedparser. I've really only learnt enough to get this up and...
6
by: affiliateian | last post by:
Total newbie here for this so please be patient. We manually update our XML feed when we publish an article on our website. Can we add a javascript tracking pixel (from phpadsnew) into the XML...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
5
by: Ed Flecko | last post by:
Hi folks, I'm trying to figure out this whole RSS feed thing. I've created my .xml file to use for my feed, and my browsers "recognize" that I have an RSS feed, and you can subscribe, etc., etc....
12
by: Marc | last post by:
Comming from JSP-HTML when I hear 'script' I think of JavaScript or perhaps VBScript. But I think in ASP.NET they mean something else? I am bit confused now. Reading a book I see the following:...
3
by: GazK | last post by:
I have been using an xml parsing script to parse a number of rss feeds and return relevant results to a database. The script has worked well for a couple of years, despite having very crude...
10
by: bhass | last post by:
From my other post I am making a simple program that creates an RSS feed with Python. Now when I run my program so far, I get errors. It says "something is not defined". The word something is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.