]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix toothpastefordinner valiant efforts to prevent scraping
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 18 Jun 2015 05:28:54 +0000 (08:28 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 18 Jun 2015 05:28:54 +0000 (08:28 +0300)
plugins/af_comics/filters/af_comics_tfd.php

index c4e5945515d06dbbdc2b8103250d927b893c94ca..d47c164eed719c286a40fda3af275a8cc7a594c5 100644 (file)
@@ -6,12 +6,15 @@ class Af_Comics_Tfd extends Af_ComicFilter {
        }
 
        function process(&$article) {
-               $owner_uid = $article["owner_uid"];
-
                if (strpos($article["link"], "toothpastefordinner.com") !== FALSE) {
-                       $doc = new DOMDocument();
+                       $res = fetch_file_contents($article["link"], false, false, false,
+                               false, false, 0,
+                               "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
 
-                       @$doc->loadHTML(fetch_file_contents($article["link"]));
+                       if (!$res) return $article;
+
+                       $doc = new DOMDocument();
+                       $doc->loadHTML($res);
 
                        $basenode = false;