X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=leistungsschutzrecht%2Fleistungsschutzrecht.php;h=c58c707f0275647b29f426dcbcf03f4fda670bb5;hb=5360f08f4295f2306d815a7659fbdff94fda01a3;hp=39eb4db13a5181db5d1016b89e5b01a6bed25654;hpb=b48ea7114ff91a1efae2dab43fc75edfeb3534f8;p=friendica-addons.git diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index 39eb4db1..c58c707f 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -66,6 +66,23 @@ function leistungsschutzrecht_cuttext($text) { function leistungsschutzrecht_fetchsites() { require_once("include/network.php"); + // This list works - but question is how current it is + $url = "http://leistungsschutzrecht-stoppen.d-64.org/blacklist.txt"; + $sitelist = fetch_url($url); + $siteurls = explode(',', $sitelist); + + $whitelist = array('tagesschau.de', 'heute.de', 'wdr.de'); + + $sites = array(); + 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. +/* $sites = array(); $url = "http://www.vg-media.de/lizenzen/digitale-verlegerische-angebote/wahrnehmungsberechtigte-digitale-verlegerische-angebote.html"; @@ -86,7 +103,7 @@ function leistungsschutzrecht_fetchsites() { if (isset($attr["href"])) { $urldata = parse_url($attr["href"]); - if (isset($urldata["host"]) AND !isset($urldata["path"])) { + if (isset($urldata["host"]) && !isset($urldata["path"])) { $cleanedurlpart = explode("%", $urldata["host"]); $hostname = explode(".", $cleanedurlpart[0]); @@ -95,6 +112,7 @@ function leistungsschutzrecht_fetchsites() { } } } +*/ if (sizeof($sites)) { set_config('leistungsschutzrecht','sites',$sites);