+ $words = explode(' ', $text);
+
+ $text = '';
+ $count = 0;
+ $limit = 7;
+
+ foreach ($words as $word) {
+ if ($text != '') {
+ $text .= ' ';
+ }
+
+ $text .= $word;
+
+ if (++$count >= $limit) {
+ if (sizeof($words) > $limit) {
+ $text .= ' ...';
+ }
+
+ break;
+ }
+ }
+ return $text;
+}
+
+function leistungsschutzrecht_fetchsites()
+{
+ // This list works - but question is how current it is
+ $url = 'https://leistungsschutzrecht-stoppen.d-64.org/blacklist.txt';
+ $sitelist = DI::httpClient()->fetch($url);
+ $siteurls = explode(',', $sitelist);
+
+ $whitelist = ['tagesschau.de', 'heute.de', 'wdr.de'];
+
+ $sites = [];
+ foreach ($siteurls as $site) {
+ if (!in_array($site, $whitelist)) {
+ $sites[$site] = $site;
+ }
+ }
+
+ // I would prefer parsing the list from the original site, but I haven't found a list.
+ // The following stays here to possibly reenable it in the future without having to reinvent the wheel completely.
+/*