Hey everyone,
I think it would be extremely useful to have an RSS feed for specific categories. Does anyone know of an easy way to do this?
Search Forums
3 posts Started 13 years ago by schmiddy Latest reply from schmiddy
Hey everyone,
I think it would be extremely useful to have an RSS feed for specific categories. Does anyone know of an easy way to do this?
While this functionality is planned for future versions of MediaCore, you can build your own, for now, using the API accessible at http://yoursite.com/api/media?category=CategoryName. This will return JSON with links to the media view pages, etc.
You can see a better description of what GET args are accepted, and what data is returned, by looking at the index method in http://github.com/simplestation/mediacore/blob/master/mediacore/controllers/media_api.py
Hope this helps,
Anthony
Thanks for the advice.
I ended up going a different route and used the PHP SimplePie library to merge all of our podcast feeds into one.
We're leveraging MediaCore a little differently, using "Podcasts" as "Message Series" at our church. So instead of having people subscribe to each message series every time a new message series is released, we have a master podcast feed which auto-discovers all of the feeds from the "http://yoursite.com/podcasts" page.
Here's the script below if anyone is interested. Keep in mind you'll still need to download the SimplePie library and put it in the same directory as this script. http://simplepie.org/
<?php
require_once('simplepie.inc');
//define the feed you are looking to discover
$feed = new SimplePie('http://yoursite.com/podcasts');
$item = $feed->get_all_discovered_feeds();
$n=0;
foreach ($feed->get_all_discovered_feeds() as $link)
{
$url[$n] = $link->url;
$n++;
}
$feed = new SimplePie($url);
$feed->handle_content_type();
?>
<!--This info will define your master iTunes feed details -->
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>Podcast Title</title>
<link>Site Link</link>
<language>en-us</language>
<docs>http://www.rssboard.org/rss-specification</docs>
<atom:link href="http://www.colonialpoint.com/podcasts.xml" rel="self" type="application/rss+xml"></atom:link>
<description>Description</description>
<itunes:subtitle>iTunes SubTitle</itunes:subtitle>
<itunes:summary>iTunes Summary </itunes:summary>
<itunes:category text="INSERT ITUNES CATEGORY HERE">
<itunes:category text="INSERT ITUNES CATEGORY HERE (if more than one)"></itunes:category>
</itunes:category>
<managingEditor>FEED EDITOR</managingEditor>
<itunes:author>Author (Displayed in iTunes)</itunes:author>
<itunes:owner>
<itunes:email>Owner Email</itunes:email>
<itunes:name>Publisher Name (Appears in iTunes)</itunes:name>
</itunes:owner>
<itunes:explicit>clean</itunes:explicit>
<image>
<url>Link to Podcast Image URL displayed in itunes</url>
<title>Image title</title>
<link>Image Link when clicked</link>
<width>128</width>
<height>128</height>
</image>
<itunes:image href="iTunes image URL"></itunes:image>
<copyright>2010</copyright>
<?php
//lets loop through the feeds and pull back the media for each. Sorted by newest first.
foreach ($feed->get_items() as $item)
{
$author = $item->get_item_tags('','author');
$itunesauthor = $item->get_item_tags('http://www.itunes.com/dtds/podcast-1.0.dtd','author');
$itunessummary = $item->get_item_tags('http://www.itunes.com/dtds/podcast-1.0.dtd','summary');
$itunessubtitle = $item->get_item_tags('http://www.itunes.com/dtds/podcast-1.0.dtd','subtitle');
$itunesduration = $item->get_item_tags('http://www.itunes.com/dtds/podcast-1.0.dtd','duration');
$ituneskeywords = $item->get_item_tags('http://www.itunes.com/dtds/podcast-1.0.dtd','keywords');
$mediathumb = $item->get_item_tags('http://search.yahoo.com/mrss/','thumb');
$enclosure = $item->get_item_tags('','enclosure');
$mediacontent = $item->get_item_tags('http://search.yahoo.com/mrss/','content');
?>
<item>
<title><![CDATA[<?php echo $item->get_title(); ?>]]></title>
<guid><![CDATA[<?php echo $item->get_permalink(); ?>]]></guid>
<pubDate><![CDATA[<?php echo $item->get_date(); ?>]]></pubDate>
<comments><![CDATA[<?php echo $item->get_permalink(); ?>#comments]]></comments>
<author><![CDATA[<?php echo $author[0][data]; ?>]]></author>
<itunes:author><![CDATA[<?php echo $itunesauthor[0][data] ?>]]></itunes:author>
<description><![CDATA[<?php echo $item->get_description();?>]]></description>
<itunes:summary><![CDATA[<?php echo $itunessummary[0][data] ?>]]></itunes:summary>
<itunes:subtitle><![CDATA[<?php echo $itunessubtitle[0][data] ?>]]></itunes:subtitle>
<itunes:duration><![CDATA[<?php echo $itunesduration[0][data] ?>]]></itunes:duration>
<itunes:keywords><![CDATA[<?php echo $ituneskeywords[0][data] ?>]]></itunes:keywords>
<media:thumb url="<?php echo $mediathumb[0][attribs][''][url] ?>" width="<?php echo $mediathumb[0][attribs][''][width] ?>" height="<?php echo $mediathumb[0][attribs][''][height]?>"></media:thumb>
<enclosure url="<?php echo $enclosure[0][attribs][''][url] ?>" length="<?php echo $enclosure[0][attribs][''][length] ?>" type="<?php echo $enclosure[0][attribs][''][type] ?>"></enclosure>
<media:content lang="<?php echo $mediacontent[0][attribs][''][lang] ?>" medium="<?php echo $mediacontent[0][attribs][''][medium] ?>" url="<?php echo $mediacontent[0][attribs][''][url] ?>" expression="<?php echo $mediacontent[0][attribs][''][expression] ?>" fileSize="<?php echo $mediacontent[0][attribs][''][fileSize] ?>" duration="<?php echo $mediacontent[0][attribs][''][duration] ?>" type="<?php echo $mediacontent[0][attribs][''][type] ?>" isDefault="<?php echo $mediacontent[0][attribs][''][isDefault] ?>"></media:content>
</item>
<?php
}
?>
</channel>
</rss>
Hope this helps someone!
You must log in to post.