summaryrefslogtreecommitdiff
path: root/plugins/af_comics
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/af_comics')
-rw-r--r--plugins/af_comics/filters/af_comics_cad.php6
-rw-r--r--plugins/af_comics/filters/af_comics_comicclass.php4
-rwxr-xr-xplugins/af_comics/filters/af_comics_comicpress.php18
-rw-r--r--plugins/af_comics/filters/af_comics_darklegacy.php4
-rw-r--r--plugins/af_comics/filters/af_comics_dilbert.php6
-rw-r--r--plugins/af_comics/filters/af_comics_explosm.php4
-rw-r--r--plugins/af_comics/filters/af_comics_gocomics.php6
-rw-r--r--plugins/af_comics/filters/af_comics_gocomics_farside.php5
-rw-r--r--plugins/af_comics/filters/af_comics_pa.php8
-rw-r--r--plugins/af_comics/filters/af_comics_pvp.php4
-rw-r--r--plugins/af_comics/filters/af_comics_tfd.php8
-rw-r--r--plugins/af_comics/filters/af_comics_twp.php4
-rw-r--r--plugins/af_comics/filters/af_comics_whomp.php4
-rwxr-xr-xplugins/af_comics/init.php2
14 files changed, 40 insertions, 43 deletions
diff --git a/plugins/af_comics/filters/af_comics_cad.php b/plugins/af_comics/filters/af_comics_cad.php
index d2eb38caf..5da82ae3f 100644
--- a/plugins/af_comics/filters/af_comics_cad.php
+++ b/plugins/af_comics/filters/af_comics_cad.php
@@ -6,14 +6,14 @@ class Af_Comics_Cad extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["link"], "cad-comic.com") !== FALSE) {
- if (strpos($article["title"], "News:") === FALSE) {
+ if (strpos($article["link"], "cad-comic.com") !== false) {
+ if (strpos($article["title"], "News:") === false) {
global $fetch_last_error_content;
$doc = new DOMDocument();
- $res = fetch_file_contents($article["link"], false, false, false,
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0");
diff --git a/plugins/af_comics/filters/af_comics_comicclass.php b/plugins/af_comics/filters/af_comics_comicclass.php
index b4b3a962c..ff32375d3 100644
--- a/plugins/af_comics/filters/af_comics_comicclass.php
+++ b/plugins/af_comics/filters/af_comics_comicclass.php
@@ -6,12 +6,12 @@ class Af_Comics_ComicClass extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["guid"], "loadingartist.com") !== FALSE) {
+ if (strpos($article["guid"], "loadingartist.com") !== false) {
// lol at people who block clients by user agent
// oh noes my ad revenue Q_Q
- $res = fetch_file_contents($article["link"], false, false, false,
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
diff --git a/plugins/af_comics/filters/af_comics_comicpress.php b/plugins/af_comics/filters/af_comics_comicpress.php
index 7755bcb1a..29b064612 100755
--- a/plugins/af_comics/filters/af_comics_comicpress.php
+++ b/plugins/af_comics/filters/af_comics_comicpress.php
@@ -7,18 +7,18 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["guid"], "bunicomic.com") !== FALSE ||
- strpos($article["guid"], "buttersafe.com") !== FALSE ||
- strpos($article["guid"], "extrafabulouscomics.com") !== FALSE ||
- strpos($article["guid"], "happyjar.com") !== FALSE ||
- strpos($article["guid"], "nedroid.com") !== FALSE ||
- strpos($article["guid"], "stonetoss.com") !== FALSE ||
- strpos($article["guid"], "csectioncomics.com") !== FALSE) {
+ if (strpos($article["guid"], "bunicomic.com") !== false ||
+ strpos($article["guid"], "buttersafe.com") !== false ||
+ strpos($article["guid"], "extrafabulouscomics.com") !== false ||
+ strpos($article["guid"], "happyjar.com") !== false ||
+ strpos($article["guid"], "nedroid.com") !== false ||
+ strpos($article["guid"], "stonetoss.com") !== false ||
+ strpos($article["guid"], "csectioncomics.com") !== false) {
// lol at people who block clients by user agent
// oh noes my ad revenue Q_Q
- $res = fetch_file_contents(["url" => $article["link"],
+ $res = UrlHelper::fetch(["url" => $article["link"],
"useragent" => "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"]);
$doc = new DOMDocument();
@@ -37,7 +37,7 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
if ($webtoon_link) {
- $res = fetch_file_contents(["url" => $webtoon_link->getAttribute("href"),
+ $res = UrlHelper::fetch(["url" => $webtoon_link->getAttribute("href"),
"useragent" => "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"]);
if (@$doc->loadHTML($res)) {
diff --git a/plugins/af_comics/filters/af_comics_darklegacy.php b/plugins/af_comics/filters/af_comics_darklegacy.php
index 0882514d0..978545431 100644
--- a/plugins/af_comics/filters/af_comics_darklegacy.php
+++ b/plugins/af_comics/filters/af_comics_darklegacy.php
@@ -7,9 +7,9 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter {
function process(&$article) {
- if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) {
+ if (strpos($article["guid"], "darklegacycomics.com") !== false) {
- $res = fetch_file_contents($article["link"], false, false, false,
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
diff --git a/plugins/af_comics/filters/af_comics_dilbert.php b/plugins/af_comics/filters/af_comics_dilbert.php
index a40f8a9ba..31a72d88d 100644
--- a/plugins/af_comics/filters/af_comics_dilbert.php
+++ b/plugins/af_comics/filters/af_comics_dilbert.php
@@ -7,10 +7,10 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["link"], "dilbert.com") !== FALSE ||
- strpos($article["link"], "/DilbertDailyStrip") !== FALSE) {
+ if (strpos($article["link"], "dilbert.com") !== false ||
+ strpos($article["link"], "/DilbertDailyStrip") !== false) {
- $res = fetch_file_contents($article["link"], false, false, false,
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0");
diff --git a/plugins/af_comics/filters/af_comics_explosm.php b/plugins/af_comics/filters/af_comics_explosm.php
index c47014da4..bfe38e53b 100644
--- a/plugins/af_comics/filters/af_comics_explosm.php
+++ b/plugins/af_comics/filters/af_comics_explosm.php
@@ -7,11 +7,11 @@ class Af_Comics_Explosm extends Af_ComicFilter {
function process(&$article) {
- if (strpos($article["link"], "explosm.net/comics") !== FALSE) {
+ if (strpos($article["link"], "explosm.net/comics") !== false) {
$doc = new DOMDocument();
- if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
+ if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('(//img[@id="main-comic"])')->item(0);
diff --git a/plugins/af_comics/filters/af_comics_gocomics.php b/plugins/af_comics/filters/af_comics_gocomics.php
index 791dc07d3..949b7a235 100644
--- a/plugins/af_comics/filters/af_comics_gocomics.php
+++ b/plugins/af_comics/filters/af_comics_gocomics.php
@@ -29,15 +29,13 @@ class Af_Comics_Gocomics extends Af_ComicFilter {
$article_link = $site_url . date('/Y/m/d');
- $body = fetch_file_contents(array('url' => $article_link, 'type' => 'text/html', 'followlocation' => false));
-
- require_once 'lib/MiniTemplator.class.php';
+ $body = UrlHelper::fetch(array('url' => $article_link, 'type' => 'text/html', 'followlocation' => false));
$feed_title = htmlspecialchars($comic[1]);
$site_url = htmlspecialchars($site_url);
$article_link = htmlspecialchars($article_link);
- $tpl = new MiniTemplator();
+ $tpl = new Templator();
$tpl->readTemplateFromFile('templates/generated_feed.txt');
diff --git a/plugins/af_comics/filters/af_comics_gocomics_farside.php b/plugins/af_comics/filters/af_comics_gocomics_farside.php
index 783907e17..9663da8f9 100644
--- a/plugins/af_comics/filters/af_comics_gocomics_farside.php
+++ b/plugins/af_comics/filters/af_comics_gocomics_farside.php
@@ -25,11 +25,10 @@ class Af_Comics_Gocomics_FarSide extends Af_ComicFilter {
public function on_fetch($url) {
if (preg_match("#^https?://www\.thefarside\.com#", $url)) {
- require_once 'lib/MiniTemplator.class.php';
$article_link = htmlspecialchars("https://www.thefarside.com" . date('/Y/m/d'));
- $tpl = new MiniTemplator();
+ $tpl = new Templator();
$tpl->readTemplateFromFile('templates/generated_feed.txt');
@@ -38,7 +37,7 @@ class Af_Comics_Gocomics_FarSide extends Af_ComicFilter {
$tpl->setVariable('FEED_URL', htmlspecialchars($url), true);
$tpl->setVariable('SELF_URL', htmlspecialchars($url), true);
- $body = fetch_file_contents(['url' => $article_link, 'type' => 'text/html', 'followlocation' => false]);
+ $body = UrlHelper::fetch(['url' => $article_link, 'type' => 'text/html', 'followlocation' => false]);
if ($body) {
$doc = new DOMDocument();
diff --git a/plugins/af_comics/filters/af_comics_pa.php b/plugins/af_comics/filters/af_comics_pa.php
index 7a60feabb..380e84596 100644
--- a/plugins/af_comics/filters/af_comics_pa.php
+++ b/plugins/af_comics/filters/af_comics_pa.php
@@ -6,11 +6,11 @@ class Af_Comics_Pa extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "Comic:") !== FALSE) {
+ if (strpos($article["link"], "penny-arcade.com") !== false && strpos($article["title"], "Comic:") !== false) {
$doc = new DOMDocument();
- if ($doc->loadHTML(fetch_file_contents($article["link"]))) {
+ if ($doc->loadHTML(UrlHelper::fetch($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('(//div[@id="comicFrame"])')->item(0);
@@ -22,10 +22,10 @@ class Af_Comics_Pa extends Af_ComicFilter {
return true;
}
- if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "News Post:") !== FALSE) {
+ if (strpos($article["link"], "penny-arcade.com") !== false && strpos($article["title"], "News Post:") !== false) {
$doc = new DOMDocument();
- if ($doc->loadHTML(fetch_file_contents($article["link"]))) {
+ if ($doc->loadHTML(UrlHelper::fetch($article["link"]))) {
$xpath = new DOMXPath($doc);
$entries = $xpath->query('(//div[@class="post"])');
diff --git a/plugins/af_comics/filters/af_comics_pvp.php b/plugins/af_comics/filters/af_comics_pvp.php
index cf0b79d78..105d3f490 100644
--- a/plugins/af_comics/filters/af_comics_pvp.php
+++ b/plugins/af_comics/filters/af_comics_pvp.php
@@ -6,9 +6,9 @@ class Af_Comics_Pvp extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["guid"], "pvponline.com") !== FALSE) {
+ if (strpos($article["guid"], "pvponline.com") !== false) {
- $res = fetch_file_contents($article["link"], false, false, false,
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
diff --git a/plugins/af_comics/filters/af_comics_tfd.php b/plugins/af_comics/filters/af_comics_tfd.php
index 376ec0714..e0216705c 100644
--- a/plugins/af_comics/filters/af_comics_tfd.php
+++ b/plugins/af_comics/filters/af_comics_tfd.php
@@ -6,9 +6,9 @@ class Af_Comics_Tfd extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["link"], "toothpastefordinner.com") !== FALSE ||
- strpos($article["link"], "marriedtothesea.com") !== FALSE) {
- $res = fetch_file_contents($article["link"], false, false, false,
+ if (strpos($article["link"], "toothpastefordinner.com") !== false ||
+ strpos($article["link"], "marriedtothesea.com") !== false) {
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
@@ -16,7 +16,7 @@ class Af_Comics_Tfd extends Af_ComicFilter {
$doc = new DOMDocument();
- if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
+ if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) {
$xpath = new DOMXPath($doc);
$basenode = $xpath->query('//img[contains(@src, ".gif")]')->item(0);
diff --git a/plugins/af_comics/filters/af_comics_twp.php b/plugins/af_comics/filters/af_comics_twp.php
index f53b89b63..38a8ca32b 100644
--- a/plugins/af_comics/filters/af_comics_twp.php
+++ b/plugins/af_comics/filters/af_comics_twp.php
@@ -7,11 +7,11 @@ class Af_Comics_Twp extends Af_ComicFilter {
function process(&$article) {
- if (strpos($article["link"], "threewordphrase.com") !== FALSE) {
+ if (strpos($article["link"], "threewordphrase.com") !== false) {
$doc = new DOMDocument();
- if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
+ if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) {
$xpath = new DOMXpath($doc);
$basenode = $xpath->query("//td/center/img")->item(0);
diff --git a/plugins/af_comics/filters/af_comics_whomp.php b/plugins/af_comics/filters/af_comics_whomp.php
index d574bf5d3..021a2952a 100644
--- a/plugins/af_comics/filters/af_comics_whomp.php
+++ b/plugins/af_comics/filters/af_comics_whomp.php
@@ -6,9 +6,9 @@ class Af_Comics_Whomp extends Af_ComicFilter {
}
function process(&$article) {
- if (strpos($article["guid"], "whompcomic.com") !== FALSE) {
+ if (strpos($article["guid"], "whompcomic.com") !== false) {
- $res = fetch_file_contents($article["link"], false, false, false,
+ $res = UrlHelper::fetch($article["link"], false, false, false,
false, false, 0,
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php
index d07220894..c99d4b1d8 100755
--- a/plugins/af_comics/init.php
+++ b/plugins/af_comics/init.php
@@ -27,7 +27,7 @@ class Af_Comics extends Plugin {
foreach ($filters as $file) {
$filter_name = preg_replace("/\..*$/", "", basename($file));
- if (array_search($filter_name, $names) === FALSE) {
+ if (array_search($filter_name, $names) === false) {
if (!class_exists($filter_name)) {
require_once $file;
}