Feature Request: Filter for rss
by Imho, Tuesday, June 04, 2013, 15:32 (4299 days ago)
In rsslounge it was possible to add a filter to my rss feeds. Could you please add them to selfoss?
Feature Request: Filter for rss
by mathcoll , Saturday, June 08, 2013, 13:59 (4295 days ago) @ Imho
Hi,
I did the same yesterday for my selfoss instance.
Here is the change I did and then, you can reach the url like these examples:
http:/selfoss.domain/rss?search=search+string
http:/selfoss.domain/rss?tag=My-tag
and you can also add some other parameters (the same as the Rss):
&type=unread
and so on...
I'm very new to selfoss and I'm not a programmer but I guess my update looks very easy:
git diff controllers/Rss.php
diff --git a/controllers/Rss.php b/controllers/Rss.php
index 6e15c62..818d360 100644
--- a/controllers/Rss.php
+++ b/controllers/Rss.php
@@ -32,13 +32,22 @@ class Rss extends BaseController {
$options = array();
if(count($_GET)>0)
$options = $_GET;
- $options['items'] = \F3::get('rss_max_items');
- if(\F3::get('PARAMS["tag"]')!=null)
- $options['tag'] = \F3::get('PARAMS["tag"]');
- if(\F3::get('PARAMS["type"]')!=null)
- $options['type'] = \F3::get('PARAMS["type"]');
-
-
+
+ $options['items'] = isset($_GET['items']) ? $_GET['items'] : \F3::get('rss_max_items');
+ if( isset($_GET['tag']) ) {
+ $options['tag'] = $_GET['tag'];
+ } else if( !is_null(\F3::get('PARAMS["tag"]')) ) {
+ $options['tag'] = \F3::get('PARAMS["tag"]');
+ }
+ if( isset($_GET['type']) ) {
+ $options['type'] = $_GET['type'];
+ } else if( !is_null(\F3::get('PARAMS["type"]')) ) {
+ $options['type'] = \F3::get('PARAMS["type"]');
+ }
+ if( isset($_GET['search']) ) {
+ $options['search'] = $_GET['search'];
+ }
+
// get items