Skip to content

Instantly share code, notes, and snippets.

@svperfecta
Last active November 23, 2015 21:17
Show Gist options
  • Save svperfecta/bd7535b42e3658c63df0 to your computer and use it in GitHub Desktop.
Save svperfecta/bd7535b42e3658c63df0 to your computer and use it in GitHub Desktop.
Example News RSS Feed

Feed will also support the media rss spec as part of our RSS parsing. This allows a nice way to provide links to assets (images, video, etc) within the rss feed in a standardized way.

This requires the tag to add additional XML namespaces (xmlns:media).

These are used within an RSS feed like so:

<?xml version="1.0"?>
<rss version="2.0"
    xmlns:xcal="urn:ietf:params:xml:ns:xcal"
>
    <channel>
        <title>Live Stream - Schedule</title>
        <link>http://pbr.com/en/bfts/schedule.aspx</link>
        <description>Professional Bull Riders - BFTS</description>
        <language>en-us</language>
        <lastBuildDate>Fri, 06 Jul 2015 09:39:21 EDT</lastBuildDate>
        <docs>http://www.rssboard.org/rss-2-0-9</docs>
        <generator>pbr.com</generator>
        <item>
            <title>Chicago Invitational</title>
            <category>Ford Tough</category>
            <guid>theooyalaassetid</guid>
            <link>http://prb.com/news/anarticle</link>
            <source>ooyala</source>
            <description>Allstate Arena</description>
            <media:content
              url = "http://server/image1.jpg"
              type = "image/jpeg"
              medium = "image">
            </media:content>
        </item>
    </channel>
</rss>

Note: Image should be 16x9, and will be cooreced into 16x9 if not correct.

An example News item:

<item>
            <title>Chicago Invitational</title>
            <category>Ford Tough</category>
            <link>http://prb.com/news/anarticle</link>
            <guid>theooyalaassetid</guid>
            <source>ooyala</source>
            <description>Allstate Arena</description>
            <media:content
              url = "http://server/image1.jpg"
              type = "image/jpeg"
              medium = "image">
            </media:content>
</item>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment