sfFeedBurnerPlugin - 1.0.1

Allows you to redirect a feed to a "burned" feed on FeedBurner.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

sfFeedBurnerPlugin

This plugin allows you to redirect a feed to a "burned" feed on FeedBurner if certain conditions are met (user-agent, IP).

You need at least to exclude FeedBurner to avoid creating an infinite loop.

Installing the plugin

php symfony plugin:install sfFeedBurnerPlugin
php symfony cc

Using the plugin

There are actually two ways of using this plugin.

The Filter method

Put this in the filters.yml of your target module or globally if you don't want to manage multiple filters.yml):

feedburner:
  class: sfFeedBurnerFilter
  param:
    redirects:
      - { module: mymodule, action: myaction, url: "http://feeds2.feedburner.com/laurentb" }
      - { module: myothermodule, action: myotheraction, url: "http://myotherurl" }

It should work nice with the cache, however it doesn't. So you have to disable the cache for this particular action.

The Action method

Add this to the top of the action:

sfFeedBurner::execute(sfConfig::get('feedburner_url'));

The cache must be disabled on this particular action! However it's fast and it's a single line (if you don't count the usage of an app.yml entry by using sfConfig, which is optional).

Customization

You can change the conditions by setting the feedburner_exlude_ua and feedburner_exlude_ip parameters in your app.yml. Both are perl-compatible regular expressions.

By default, no IPs are excluded, and the user-agents of FeedBurner, FeedValidator, Yahoo! Slurp and Googlebot (Googlebot, not Google Reader) are excluded. The rationale for the last two is that you might want to add them as sitemaps and they don't play nice with FeedBurner special tracking URLs (if you enable the feature).