sfFeedBurnerPlugin /

Filename Size Date modified Message
lib
94 B
1.0 KB
1.7 KB
1.8 KB
2.7 KB
# 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).

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.