Rivendell: perl script to import RSS feed into a Rivendell cart

This is a very simple perl script that will take the first item (MP3) off of an RSS podcast feed and import it to the defined cart.
  • First, you must build the cart in Rivendell using rdlibrary.
  • REC-FM uses this script called from cron to download and import the latest program from sources like Radio4All.
  • We do note that this script will not work when there are any special characters in the URL (plus signs to replace spaces are OK but when you start getting into anything else, it does not work). In those cases, you may have to write a different script that hard codes in the URL for the RSS feed under the $url variable and the cart number under the $cart variable.
  • Usage as shown: perl recrss.pl http://recfm.org/feed.xml 12345 which includes the feed URL and the cart number (12345) to import it into. Remember, if you are putting it into cron, please make sure you use the full path to the location of the perl file (i.e. /home/rd/recrss.pl )
  • In the code below, it is writing the MP3 to a temporary location in directory /home/rd/rss. You can change that to whatever directory you want to write that too. Make sure that the directory exists and the proper permissions are in place.
  • Happy downloading!