Importing RSS & XML Feeds

Help :: Developer Resources

Last modified: 04:09 pm on Nov 16, 2009

Concerto can automatically generate and update content items from an RSS/XML feed for consumption by screens in the system.  Currently, this process does not have an interface exposed in the Admin panel.  You’ll need access to the database (phpMyAdmin works well) to perform this setup.

Outside content sources are imported in dynamic feeds in Concerto.  Dynamic feeds update automatically when the cronjob runs ensuring the content is always up to date.

Setup the destination feed

  1. Login as an administrator
  2. Navigate to the Browse Content page and click the New Feed button up top.
  3. Enter an appropriate name & description for the feed.  Select the “System Adminstrator” group for the feed owner.  Set the feed type to “Restricted” so no one can use the feed while its being setup.

Database Work

  1. Login to your database.   We use phpMyAdmin, but any database management tool that can add/edit records should work.
  2. Navigate to the Dynamic table and prepare to INSERT a new record.
  3. Set the type field to 1, the path field to the URL of your RSS feed, enter a ruleset into the rules field (see below), and set the update_interval to the minumun number of seconds between an update.  For an urgent feed you can use 0 seconds to always update, but most RSS news sources can wait a few minutes.  We use 600 seconds (10 minutes) for many of our feeds.
  4. Save the record, and note the id it was assigned in the dynamic table.
  5. Navigate to the Feed and browse to find the record associated with the feed you setup in the first part of the guide.
  6. Edit/UPDATE the record for the destination feed, changing the type to 1 and the dynamic_id to the id of the entry added to the dynamic table (step 4).
  7. You’re all set, navigate to http:///common/scripts/cron.php to manually update the system or wait for the next cronjob run.

Rulesets

The dynamic table uses the rule field to store information that tells the system how to process the RSS/XML input feed.  These rules control the HTML formatting the content is presented in and what operations are conducted on the source content (aggregation, truncation, regex, etc). This data is stored as a serialized PHP array.  Until full documentation for the rulesets is prepared, there are a few sample rulesets you can try.  Do not directly manipulate the content of these rules, unserialize them into the PHP array, make your changes, and re-serialize if needed.

Show the 5 headlines per content for an RSS feed

Path: http://arstechnica.com/index.rssx

Rule:

Show 1 story per content for an RSS feed

Path: http://rss.news.yahoo.com/rss/topstories

Rule:

Display the Weather:

Path: http://weather.yahooapis.com/forecastrss?p=12180

Rule: