aboutsummaryrefslogtreecommitdiff
path: root/lib/core-extensions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core-extensions')
-rw-r--r--lib/core-extensions/README.md5
-rw-r--r--lib/core-extensions/Tumblr-GDPR/README.md4
-rw-r--r--lib/core-extensions/Tumblr-GDPR/extension.php13
-rw-r--r--lib/core-extensions/Tumblr-GDPR/metadata.json8
4 files changed, 30 insertions, 0 deletions
diff --git a/lib/core-extensions/README.md b/lib/core-extensions/README.md
new file mode 100644
index 000000000..7d48fbffd
--- /dev/null
+++ b/lib/core-extensions/README.md
@@ -0,0 +1,5 @@
+# FreshRSS core extensions
+
+This directory contains some core extensions shipped with FreshRSS.
+
+For custom third-party extensions, use the `./FreshRSS/extensions/` directory instead.
diff --git a/lib/core-extensions/Tumblr-GDPR/README.md b/lib/core-extensions/Tumblr-GDPR/README.md
new file mode 100644
index 000000000..fc5e4dd50
--- /dev/null
+++ b/lib/core-extensions/Tumblr-GDPR/README.md
@@ -0,0 +1,4 @@
+# Tumblr-GDPR
+
+Needed for accessing [Tumblr](https://www.tumblr.com/) RSS feeds from the European Union:
+bypass the [GPDR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation) check, implying consent.
diff --git a/lib/core-extensions/Tumblr-GDPR/extension.php b/lib/core-extensions/Tumblr-GDPR/extension.php
new file mode 100644
index 000000000..83bdf2189
--- /dev/null
+++ b/lib/core-extensions/Tumblr-GDPR/extension.php
@@ -0,0 +1,13 @@
+<?php
+
+class TumblrGdprExtension extends Minz_Extension {
+ public function init() {
+ $this->registerHook('simplepie_before_init', array('TumblrGdprExtension', 'curlHook'));
+ }
+
+ public static function curlHook($simplePie, $feed) {
+ if (preg_match('#^https?://[a-zA-Z_0-9-]+.tumblr.com/#i', $feed->url())) {
+ $simplePie->set_useragent(FRESHRSS_USERAGENT . ' like Baiduspider');
+ }
+ }
+}
diff --git a/lib/core-extensions/Tumblr-GDPR/metadata.json b/lib/core-extensions/Tumblr-GDPR/metadata.json
new file mode 100644
index 000000000..b5c33787b
--- /dev/null
+++ b/lib/core-extensions/Tumblr-GDPR/metadata.json
@@ -0,0 +1,8 @@
+{
+ "name": "Tumblr-GDPR",
+ "author": "Alkarex",
+ "description": "Bypass Tumblr’ GPDR check (implying consent) for the European Union",
+ "version": 1.0,
+ "entrypoint": "TumblrGdpr",
+ "type": "system"
+}