Example MRSS Reader (Powershell) 📄

This simple script will load your MRSS feed and convert the XML values of the first media object. This is a good starting point to build powerful automation.

Powershell 

#############################
### Enforce use of TLS 1.2###
#############################
[Net.ServicePointManager]::SecurityProtocol =
[Net.SecurityProtocolType]::Tls12

#####################
### Set variables ###
#####################
$holdingFile = "[The location on disk where the MRSS feed is to be saved and recalled]"
$mrssFeedUri = "https://[Your Imagen Domain]/user/rss/feed_[Feed ID]?limit=[100]"
                                          
########################
### make web request ###
########################
$mrssContentType="text/xml"
Invoke-WebRequest $mrssFeedUri -ContentType $mrssContentType -OutFile $holdingFile

#############################
### Load MRSS feed as XML ###
#############################
[xml]$mrssContent = (GC $holdingFile)

################################
### Set a namespace manager ####
################################
$nsmgr = New-Object System.Xml.XmlNamespaceManager $mrssContent.NameTable
$nsmgr.AddNamespace('media','http://search.yahoo.com/mrss/')

#####################################################
### Populate an array of items taken the MRSS XML ###
#####################################################
[array]$nodes = $mrssContent.SelectNodes('/rss/channel/item', $nsmgr)

foreach($node in $nodes)
{
$recordId = $node.guid
[string]$title = $node.title.'#cdata-section'
[string]$description = $node.description.'#cdata-section'
[string]$link = $node.link

[array]$subNodes = $node.group.content

foreach($subNode in $subNodes)
{
[string]$renditionName = $subNode.description.'#cdata-section'
[string]$renditionlLink = $subNode.url
}
}