Monday, November 16, 2009

How to save rss feeds to a .txt file automaticly.?

How to save rss feeds to a .txt file automaticly.





Im trying to build an LED matrix that can scroll RSS feeds, but fist i need a way for the rss feed to be converted to a .txt file and saved.





any software ideas or any information at all would be great.

How to save rss feeds to a .txt file automaticly.?
Um ... you don't indicate how you are retrieving the RSS feeds, so it's difficult to answer.





But there's nothing stopping you from saving any XML doc as a text file in any language.





For example, if you get the file via fopen() in PHP, you can simply use fwrite() to make a new text file:





%26lt;?php


$in = fopen('http://site.com/rss.rss', 'r') or die('Cannot open RSS feed');


while(feof( $in ) ) {


$data .= fgets( $in );


}


fclose($in);


$out = fopen('rss.txt', 'w') or die('Cannot create output file');


fwrite($out, $data);


fclose($out);


?%26gt;


No comments:

Post a Comment