Skip to topic | Skip to bottom
Home
Search:

Devel
Devel.MirSimpleRssFeedSetupr1.2 - 12 Dec 2005 - 19:30 - SdLotustopic end
You are here: Devel > MiR > MirSimpleRssFeedSetup

Start of topic | Skip to actions
I'm not claiming this is the best method, only that this is what we did in San Diego with Zapata's help.

Simple Rss Feed Setup in Mir

Rss Template

First, you need to add an rss template to etc/producers in your mir directory.

Our template is here:

current version: https://codecoop.org/plugins/scmcvs/cvsweb.php/etc/producer/rss.1-0.template?rev=1.2;cvsroot=imc-sd

version history: https://codecoop.org/plugins/scmcvs/cvsweb.php/etc/producer/rss.1-0.template?cvsroot=imc-sd

Add producer

Second, you need to add a producer to your producers.xml file, ours is here, right after the media producer:

<!-- rss -->
  <nodedefinition name="RSSChannel">
    <parameters>
      <string name="articleSelection"/>
      <integer name="limit" defaultvalue="15"/>
      <string name="channelidentifier"/>
      <string name="channelfilename"/>
      <string name="channeltitle"/>
      <string name="channelpublisher" defaultvalue="san diego indymedia" />
      <string name="channeldescription" defaultvalue="features from san diego"/>
      <string name="generator" defaultvalue="rss.1-0.template"/>
      <string name="articleprefix" defaultvalue="http://sandiego.indymedia.org/en"/>
      <string name="iconprefix" defaultvalue="http://sandiego.indymedia.org"/>
    </parameters>
                                                                                                              
    <definition>
      <List key="articles" table="content" selection="${articleSelection}" order = "webdb_create desc, date desc" limit="limit"/>
                                                                                                              
      <Generate
         parameters="UTF-8"
         generator="${generator}"
         destination="${config.storageRoot}/${channelfilename}"/>
    </definition>
  </nodedefinition>

  <producer name="rss">
    <verbs>

      <verb name="generate" default="1" />
    </verbs>
    <body>
       <RSSChannel
          articleSelection="to_article_type in (${articletype.feature},${articletype.oldfeature},${articletype.startspecial})"
          channelidentifier="http://sandiego.indymedia.org/sdimc.rss"
          channelfilename="sdimc.rss"
          channeltitle="san diego imc"
          limit="20" />
                                                                                                              
    </body>
  </producer>

Here it is in codecoop:

https://codecoop.org/plugins/scmcvs/cvsweb.php/etc/producer/producers.xml?rev=1.9;cvsroot=imc-sd

The url of the feed is determined by "channelfilename", so ours is

http://sandiego.indymedia.org/sdimc.rss

Schedule producer

Then, edit etc/config.properties so that when someone hits "generate all new", the rss file gets regenerated .

To do this, change this line in your config.properties file to add rss.run:

# Which producers need to be called after the "produce all new" link is clicked from admin Mir.Localizer.Producer.AllNewProducers= media.new;articles.changed;startpage.run;synchronization.run;rss.run

Since this is a feature rss feed, its probably better to have the rss generated with features get added, but I'm not exactly sure how to do that. Also, our images don't show up in our feed, and I'm not sure why.

Hope this helps!

-- created - SdLotus - 09 Dec 2005
to top


You are here: Devel > MiR > MirSimpleRssFeedSetup

to top

Copyright © 1999-2008 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding this tool? Send feedback (in English, Francais, Deutsch or Dutch).