473,785 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ 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 2476
On 2004-12-28, ARGENTINA <sj****@yahoo.c om> 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_conten ts($_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."slas hdot.rdf");
$remote = "http://slashdot.org/slashdot.rdf";
$refreshtime = time() - 3600;

if ((filemtime($rd ffile) < $refreshtime) ||
(filesize($rdff ile) == 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."slas hdot.rdf");
$remote = "http://slashdot.org/slashdot.rdf";
$refreshtime = time() - 3600;

if ((filemtime($rd ffile) < $refreshtime) ||
(filesize($rdff ile) == 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
7904
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
1890
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 example, the weboage will have a link to download file A, but the one stored in the server is not exactly file A, but some transformation of it. If the user click the link, it activate the script which will actually load the file from the server,...
6
1915
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 running. Any tips on the code quality and use of python would be appreciated. I've got a feeling the overall structure is up the creek. approx 220 LOC. file: GodCast.py
6
2370
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 file to track how many times our feed was accessed? Just to get a rough idea how manyh subscribers we have? Not sure if copying and pasting a javascript into the XML source would work.
7
3190
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" name="file_1" size=46 /><input type=submit /> so, after adding a few files, the input fields look like this:
5
2436
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. Here's why I "think" I want to use an RSS feed, and what I'm confused about. I have one file (and one file only) on my web site that changes
12
1747
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: A simple Web page may look like the following. <!-page directives--> <%@ Page Language="VB" %>
3
4515
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 error-trapping (if it finds an error in one of the xml files, the script stops). Recently, the script has stopped working because one of the xml files is badly formed. So I decided to rewrite the script with better error trapping; the script should...
10
2390
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 replaced by the name of the function I'm trying to use. my article function when ran, comes up with "article is not defined" etc. Here's my code: What is wrong with it? #!/usr/bin/env python import ftplib import getpass def mainfeed(): ...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10155
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8978
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.