From daa4922d908fb9ad5d973c597d0c60f769236c3e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 22 Mar 2020 16:59:39 +0100 Subject: Add core extension for Google Groups (#2838) * Add core extension for Google Groups #Fix https://github.com/FreshRSS/FreshRSS/issues/2835 Add ability to discover RSS feeds for Google Groups Based on https://github.com/FreshRSS/FreshRSS/pull/2837 * Allow HTTP in addition of HTTPS --- lib/core-extensions/Google-Groups/README.md | 3 +++ lib/core-extensions/Google-Groups/extension.php | 10 ++++++++++ lib/core-extensions/Google-Groups/metadata.json | 8 ++++++++ 3 files changed, 21 insertions(+) create mode 100644 lib/core-extensions/Google-Groups/README.md create mode 100644 lib/core-extensions/Google-Groups/extension.php create mode 100644 lib/core-extensions/Google-Groups/metadata.json (limited to 'lib/core-extensions') diff --git a/lib/core-extensions/Google-Groups/README.md b/lib/core-extensions/Google-Groups/README.md new file mode 100644 index 000000000..21b901ded --- /dev/null +++ b/lib/core-extensions/Google-Groups/README.md @@ -0,0 +1,3 @@ +# Google Groups + +Needed for discovering RSS feeds from [Google Groups](https://groups.google.com). diff --git a/lib/core-extensions/Google-Groups/extension.php b/lib/core-extensions/Google-Groups/extension.php new file mode 100644 index 000000000..656bf9b8f --- /dev/null +++ b/lib/core-extensions/Google-Groups/extension.php @@ -0,0 +1,10 @@ +registerHook('check_url_before_add', array('GoogleGroupsExtension', 'findFeed')); + } + + public static function findFeed($url) { + return preg_replace('%^(https?://groups.google.com/forum)/#!forum/(.+)$%i', '$1/feed/$2/msgs/rss.xml', $url); + } +} diff --git a/lib/core-extensions/Google-Groups/metadata.json b/lib/core-extensions/Google-Groups/metadata.json new file mode 100644 index 000000000..afaa18392 --- /dev/null +++ b/lib/core-extensions/Google-Groups/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "Google-Groups", + "author": "Alkarex", + "description": "To discover RSS feeds for Google Groups", + "version": 1.0, + "entrypoint": "GoogleGroups", + "type": "system" +} -- cgit v1.2.3