Rewriting URL in RSS Feed

Status
Not open for further replies.

bam bam

New member
Oct 9, 2007
962
11
0
How would one go about rewriting the URL's in another websites RSS feed and parsing it as another feed?

Example:

I have an aff program with Home - ABC.com so i want to take their "latest products" feed and add my aff URL to all of the items. Then parse that as a separate feed for use on other websites.

That make sense? :error:
 


Not really got time to look up the proper syntax (I can never remember stuff), but using php something like:

$feed = fopen('feed.xml', 'r');

$new_feed = str_replace($their_url, $your_url, $feed); //use regex to match the urls? or create a db with all of the orig & aff ones maybe?

fwrite('new_feed.xml', $new_feed);

I'm sure i've prob got that a bit wrong, but something along those lines maybe?
 
np. thinking about it I'm sure the fwrite bit is wrong - think you need to use fopen ("file", "w") or something similar with it.
 
Status
Not open for further replies.