Custom RSS Feeds

Creating a custom RSS or XML feed is easy using Media Factory applications. Just follow these steps:

  1. Create a new blank application in your Media Factory project and assign it a URL like http://myrss.projects.fm. If you don't have permissions to create applications, speak with your project administrator or email support@newspark.ca.
  2. Download the custom RSS application XML backup and restore it into the blank application, or put in a request with Support to do this for you. You can now customize the contents of the XML file with your own tags or additional data.
  3. Visit the application you just created at the URL you selected in step 1.
  4. Add query strings to the feed-dynamic URL to request sub-sets of data in your project.

There are two templates included in the Custom RSS application: static and dynamic. If you only need one feed, just modify the static feed template and you're done. If you want to pull various sub-sets of data (such as programmatically into a CMS) use the dynamic feed.

Note: This default application assumes no public media detail page, and therefore links to the file in Media Factory.

Sample

You can also just copy this example dynamic feed into a template in an existing application:


<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" >
    <channel>
        <title>{%feed:title}</title>
        <link>http://{$vhost}/</link>
        <description>{%feed:description}</description>
        <atom:link href="http://{$vhost}/{$basepage}?channel={$get.channel}&amp;collection={$get.collection}&amp;groupId={$get.groupId}&amp;sort={$get.sort}&amp;fileTypes={$get.fileTypes}" rel="self" type="application/rss+xml" />
        <!--<image>
            </url>
            </title>
            </link>
        </image> -->
        
        <!-- For details on <fm:MediaList> parameters visit http://developer.mediafactory.fm/doc/applications/components/fm_medialist -->
        
        <fm:MediaList
            fields="id,title,message,user_name,date,publicUrl,uid,user_firstname,user_lastname,filetype,filesize,notdeniedcomments"
            channel="{$get.channel}"
            collection="{$get.collection}"
            fileTypes="{$get.fileTypes}"
            includeChildren="1"
            moderationStatus="notdenied"
            groupId="{$get.groupId}"
            includeChildGroups="true"
            sort="{$get.sort}"
            >
                <fm:Loop>
                    <fm:Switch value="{$media_filetype}">
                        <fm:Case value="1">
        
                            <item>
                                <title>{$$media_title}</title>
                                <!--Use http://{$vhost}/mediadetail/{$$mid} to link to the base URL of this application -->
                                <link>
                                http://mediafactory.fm/mediadetail/{$$mid}?vid={$vhostid}
                                </link>
                                <description>
                                <![CDATA[
                                <p>{$$media_user_firstname} {%feed:postedPhoto}:</p> <p><img src="{$$media_publicUrl}/15" alt="{$$media_title}" /></p><p>{$$media_message}</p>
                                ]]>
                                </description>
                                <pubDate><fm:DateFormat date="{$$media_date}" format="r" /></pubDate>
                                <guid isPermaLink="false">http://mediafactory.fm/mediadetail/{$$mid}?vid={$vhostid}</guid>
                                <media:content url="{$$media_publicUrl}/15" type="image/jpeg"/>
                                <media:title>{$$media_title}</media:title>
                                <media:description>{$$media_message}</media:description>
                                <media:thumbnail url="{$$media_publicUrl}/14"/>
                                <media:credit role="photographer" scheme="urn:ebu">{$$media_user_firstname} {$$media_user_lastname}</media:credit>
                            </item>
                            
                            </fm:Case>
                        
                        <fm:Case value="2">
                            
                            <item>
                                <title>{$$media_title}</title>
                                <!--Use http://{$vhost}/mediadetail/{$$mid} to link to the base URL of this application -->
                                <link>
                                http://mediafactory.fm/mediadetail/{$$mid}?vid={$vhostid}
                                </link>
                                <description>
                                <![CDATA[
                                <p>{$$media_user_firstname} {%feed:postedVideo}:</p> <p><img src="{$$media_publicUrl}/15" alt="{$$media_title}" /></p><p>{$$media_message}</p>
                                ]]>
                                </description>
                                <pubDate><fm:DateFormat date="{$$media_date}" format="r" /></pubDate>
                                <guid isPermaLink="false">http://mediafactory.fm/mediadetail/{$$mid}?vid={$vhostid}</guid>
                                <media:content url="{$$media_publicUrl}/2405" type="video/quicktime"/>
                                <media:title>{$$media_title}</media:title>
                                <media:description>{$$media_message}</media:description>
                                <media:thumbnail url="{$$media_publicUrl}/14"/>
                                <media:credit role="producer" scheme="urn:ebu">{$$media_user_firstname} {$$media_user_lastname}</media:credit>
                            </item>
                            
                        </fm:Case>
                        
                        <fm:Case value="3">
                            
                            <item>
                                <title>{$$media_title}</title>
                                <!--Use http://{$vhost}/mediadetail/{$$mid} to link to the base URL of this application -->
                                <link>
                                http://mediafactory.fm/mediadetail/{$$mid}?vid={$vhostid}
                                </link>
                                <description>
                                <![CDATA[
                                <p>{$$media_user_firstname} {%feed:postedAudio}:</p> <p><img src="http://{$vhost}/static/vidcom/v2/images/audio.gif" alt="{$$media_title}" /></p><p>{$$media_message}</p>
                                ]]>
                                </description>
                                <pubDate><fm:DateFormat date="{$$media_date}" format="r" /></pubDate>
                                <guid isPermaLink="false">http://mediafactory.fm/mediadetail/{$$mid}?vid={$vhostid}</guid>
                                <media:content url="{$$media_publicUrl}/31" type="audio/mpeg"/>
                                <media:title>{$$media_title}</media:title>
                                <media:description>{$$media_message}</media:description>
                                <media:thumbnail url="http://{$vhost}/static/vidcom/v2/images/audio.gif"/>
                                <media:credit role="producer" scheme="urn:ebu">{$$media_user_firstname} {$$media_user_lastname}</media:credit>
                            </item>
                            
                        </fm:Case>
                        
                    </fm:Switch>
                </fm:Loop>
                
        </fm:MediaList>
    </channel>
</rss>

Related Component Docs

0 comments

Be the first to comment on Custom RSS Feeds.

Add a Comment

  • captcha