RSS Podcast

In a older post, Torben gave us this:

[quote=“Torben, post:1, topic:7154”]Here’s a small script I wrote. It checks the RSS feed for a podcast (for example, Democracy Now) and downloads the most recent episode to a file on your hard disk.

You need at least Build 861 of mAirList 3.1.4, and curl.exe from here: http://curl.haxx.se/download.html (scroll to the bottom of the page for the non-SSL Win32 binary). Adjust all paths as needed.

[code]
var
doc: IXMLDocument;
n: IXMLNode;

begin
doc := Factory.CreateXMLDocumentFromString(HTTPGet(‘http://www.democracynow.org/podcast.xml’));
n := doc.GetDocumentElement.SelectSingleNode(’/rss/channel/item/enclosure’);
ShellExecute(‘c:\apps\curl.exe’, ‘-L -o c:\tmp\democracynow.mp3 "’ + IXMLElement(n).GetAttribute(‘url’) + ‘"’);
end.
[/code][/quote]

Any chance there would be an updated Script that would work in 4.4 or newer? That would be great.

The XML library has changed since I wrote that script. Here’s a new version works with mAirList 4.4 and 5.0:

var
  doc: ISXMLDocument;
  n: ISXMLNode;

begin
  doc := Factory.CreateXMLDocumentFromString(HTTPGet('http://www.democracynow.org/podcast.xml'));
  n := doc.GetDocumentElement.SelectNode('/rss/channel/item/enclosure');
  ShellExecute('c:\apps\curl.exe', '-L -o c:\tmp\democracynow.mp3 "' + n.GetAttribute('url') + '"');
end.
1 Like