Importing Information from RSS Feeds

You can set up your Webvanta site to periodically import information from any RSS feed into your database.

By pulling content from RSS feeds into your database, you can apply your own ratings, or delete items you don't want to include. You can present them with complete flexibility, just like any other database content.

As an extra bonus, the information from the RSS feed appears to search engine spiders as if it is part of your site; if you use a JavaScript widget instead, the RSS content is invisible to spiders.

In cases where you don't care about the RSS content being visible to search engines, and don't want to add all the feed items to your database, we also provide another method, outlined at the end of this article.

Staying Legal

When you import another RSS feed into your site and present that content, you may be infringing the feed creator's copyright. This kind of aggregation is legal under copyright law only if your use falls under the "fair use" doctrine, which is frustratingly vague.

The safest approach is to ask the RSS feed source for permission before you use their content. Next best is to show only headlines, and perhaps the first sentence or two, but there is no clear precendent about how much content is ok to list in a aggregated fashion. Always identify the name of the RSS feed that was the source and link to the item on the source's web site.

Note: You are responsible for the legality of whatever content you present on your site. Webvanta does not provide legal advice.

Setting Up the Feed

You control the feed import function via these configuration settings (Settings > Global Settings):

Setting Description Example
(don't include quotes)
admin.auto_feed.triggered Enable feed import "true" or "false"
admin.auto_feed.url RSS Feed URL "http://feeds.feedburner.com/webvanta-blog"
admin.auto_feed.type Database item type to use "Web Article"
admin.auto_feed.category Category to assign to all imported items (optional) "News"
admin.auto_feed.import_as_draft If set to true, imported items are set as "draft", so they don't appear unless a moderator unchecks the Draft box "true"

You can use one of the standard database link types, such as "Web Article", for the imported items (as determined by the config setting admin.auto_feed.type), or you can create a new link type called something like "rss import" if you want to keep the imported items separate. Note that you must use a link type, not a custom item type.

How It Works

Twice a day, Webvanta will read the contents of the specified RSS feed. Any items that are already in the database are ignored. For each new item in the feed, a new database item is added. The headline of the RSS item becomes the title of the DB item, and the text of the RSS item becomes the body of the DB item. The author is also captured, and the link to the full post is saved in the DB item's URL field.

Webvanta does not, at this point, import any tags or keywords associated with the post. You can have all feed items assigned to a single category using the config setting admin.auto_feed.category, but to categorize imported items more specifically, you'll need to review them and assign to a category just like any other DB item.

Using Multiple Feeds

Webvanta currently supports import of only a single feed per site. You can, however, use a third-party service, such as Yahoo Pipes to combine multiple feeds, and then import the combined feed into Webvanta.

An Alternate Approach: Capturing to a File

Sometimes you want to be able to access content from an RSS feed with JavaScript, but you don't want to import the feed into your database. We provide another mechanism to support this.

The following config settings tell Webvanta to read the specified feed, and write it as a file on your site. You can then access that file with whatever JavaScript code you want.

SettingDescriptionExample
admin.feed_cloner.urlSpecify feed URL and name of file to be written[{"url": "http://www.feedsource.com/feed.xml", "file": "feed-filename.xml"}]
admin.feed_cloner.folderSpecify the folder into which the file is writtenfeed_store
admin.feed_cloner.activeEnables feed capturetrue

This supports any number of feeds; in the first setting, specify each of the URLs and file names in a JSON-encoded pair of values(e.g., [{"url": "http://www.feed1.com/feed.xml", "file": "feed1.xml"},{"url": "http://www.feed2.com/feed.xml", "file": "feed2.xml"}].

All specified feeds are read once per hour and written to the file(s). The previous version is overwritten.