Adds RSS feed. Closes #26. No link or anything, but accessible at /rss

This commit is contained in:
James Brooks
2014-11-27 14:31:33 +00:00
parent b7d49568f6
commit 252b6a1126
5 changed files with 79 additions and 6 deletions
+24
View File
@@ -20,3 +20,27 @@
// Authorization stuff.
Route::get('/auth/logout', 'AuthController@logoutAction');
});
Route::get('/rss', function() {
$feed = RSS::feed('2.0', 'UTF-8');
$feed->channel([
'title' => Setting::get('app_name'),
'description' => 'Status Feed',
'link' => Setting::get('app_domain'),
]);
Incident::get()->map(function($incident) use ($feed) {
$feed->item([
'title' => $incident->name,
'message' => $incident->message,
'component' => $incident->parent->name,
'status' => $incident->humanStatus,
'created_at' => $incident->created_at,
'updated_at' => $incident->updated_at
]);
});
return Response::make($feed, 200, [
'Content-Type' => 'text/xml'
]);
});