Permalink
Browse files

Filled the README.

  • Loading branch information...
1 parent a3cdafa commit 4a914f066cbba1c70405fc0db58fe5be0a854324 Pavel committed May 11, 2012
Showing with 74 additions and 3 deletions.
  1. +74 −3 README.md
View
@@ -1,4 +1,75 @@
-Feeder
-======
+# Feeder
-Laravel bundle and standalone module to generate standards-compliant RSS 0.92, 2.0 and Atom feeds from a single data source.
+This bundle lets you generate **RSS 2.0**, **RSS 0.92** and **Atom** feeds by just setting the data you want - and __Feeder__ will take care of mapping it to the target standard-specific output.
+
+[Sample generated feeds, detailed API and description](http://proger.i-forge.net/PHP_Feeder/7sg).
+
+It's used in real action on Laravel.ru's article feed: [RSS 2.0](http://laravel.ru/feed/articles/rss20) | [RSS 0.92](http://laravel.ru/feed/articles/rss092) | [Atom](http://laravel.ru/feed/articles/atom) [all three are generated using the code almost identical to the example below].
+
+### Features
+Before creating this I have [dug through](http://proger.i-forge.net/Syndication_formats_%E2%80%93_RSS_0_92_2_0_-amp_Atom_1_0/7Zf) every bit in those specifications (RSS 2.0, 0.92 and Atom) so it should be pretty complete.
+
+- Pretty output with indentation
+- W3C Validation passed for all 3 formats
+- Unicode-aware
+- You can generate feeds from YAML text files without coding anything - [details](http://proger.i-forge.net/PHP_Feeder/7sg#textfeeder)
+
+### Example
+```PHP
+$feed = Feed::make();
+
+$feed->logo(asset('logo.png'))
+ ->icon(URL::home().'favicon.ico')
+ ->webmaster('Proger_XP proger.xp@gmail.com http://i-forge.net/me')
+ ->author ('Proger_XP proger.xp@gmail.com http://i-forge.net/me')
+ ->rating('SFW')->
+ ->pubdate(time())
+ ->ttl(60)
+ ->title('My feed')
+ ->description('Sample feed generated by PHP Feeder.')
+ ->copyright('(c) '.date('Y').' Example.com')
+ ->permalink(route('feed', 'rss20'))
+ ->category('PHP')
+ ->language('ru_RU')
+ ->baseurl(URL::home());
+
+foreach ($posts as $post) {
+ $feed->entry()->published($post['published'])
+ ->description()->add('html', $post['synopsis'])->up()
+ ->title($post['title'])
+ ->permalink($post['url'])
+ ->author($post['author'])
+ ->updated($post['posted']);
+}
+
+$feed->send('rss20');
+// or just $feed->Rss20(); - or Rss092() - or ->Atom()
+```
+
+### Installation
+```
+php artisan bundle:install feeder
+```
+
+**application/bundles.php**:
+```PHP
+'feeder' => array(
+ // when the bundle is started all Feeder classes are automatically loaded
+ // so you can either autostart it or have autoloader mappings (more efficient).
+ //'auto' => true,
+
+ 'autoloads' => array(
+ 'map' => array(
+ 'Feed' => '(:bundle)/chained.php',
+
+ 'FeedChannel' => '(:bundle)/feeder.php',
+ 'FeedEntry' => '(:bundle)/feeder.php',
+ 'Feeder' => '(:bundle)/feeder.php',
+ 'TextFeeder' => '(:bundle)/feeder.php',
+ 'FeedOut' => '(:bundle)/feeder.php',
+ ),
+ ),
+),
+```
+
+> The list of autoloader mappings depends on your application - if you're just using chained calls (as in the example above) you only need the first **Feed => chained** mapping; otherwise you might want to autostart the bundle if you're unsure. You can also define [IoC containers](http://laravel.com/docs/ioc) for starting the bundle when it's used.

0 comments on commit 4a914f0

Please sign in to comment.