plugins: remove obsolete plugin_data/stored stuff

master
Andrew Dolgov 10 years ago
parent b1840673cd
commit 129d626354

@ -9,7 +9,7 @@ class Af_Comics_Cad extends Af_ComicFilter {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) { if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) {
if (strpos($article["title"], "News:") === FALSE && strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { if (strpos($article["title"], "News:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -22,12 +22,9 @@ class Af_Comics_Cad extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
} }
return true; return true;

@ -16,8 +16,6 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
strpos($article["guid"], "happyjar.com") !== FALSE || strpos($article["guid"], "happyjar.com") !== FALSE ||
strpos($article["guid"], "csectioncomics.com") !== FALSE) { strpos($article["guid"], "csectioncomics.com") !== FALSE) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
// lol at people who block clients by user agent // lol at people who block clients by user agent
// oh noes my ad revenue Q_Q // oh noes my ad revenue Q_Q
@ -36,11 +34,7 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
}
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
} }
return true; return true;

@ -9,9 +9,6 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) { if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
print "DLC!" . $article["link"] . "\n";
$res = fetch_file_contents($article["link"], false, false, false, $res = fetch_file_contents($article["link"], false, false, false,
false, false, 0, false, false, 0,
@ -34,11 +31,7 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
}
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
} }
return true; return true;

@ -9,7 +9,6 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["guid"], "dilbert.com") !== FALSE) { if (strpos($article["guid"], "dilbert.com") !== FALSE) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -36,12 +35,8 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
return true; return true;
} }

@ -9,7 +9,6 @@ class Af_Comics_Explosm extends Af_ComicFilter {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "explosm.net/comics") !== FALSE) { if (strpos($article["link"], "explosm.net/comics") !== FALSE) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -33,12 +32,8 @@ class Af_Comics_Explosm extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
return true; return true;
} }

@ -9,7 +9,6 @@ class Af_Comics_GoComics extends Af_ComicFilter {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["guid"], "gocomics.com") !== FALSE) { if (strpos($article["guid"], "gocomics.com") !== FALSE) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -42,12 +41,8 @@ class Af_Comics_GoComics extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
return true; return true;
} }

@ -6,10 +6,7 @@ class Af_Comics_Pa extends Af_ComicFilter {
} }
function process(&$article) { function process(&$article) {
$owner_uid = $article["owner_uid"];
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) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
if ($debug_enabled) { if ($debug_enabled) {
_debug("af_pennyarcade: Processing comic"); _debug("af_pennyarcade: Processing comic");
@ -26,18 +23,13 @@ class Af_Comics_Pa extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
}
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
} }
return true; 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) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
if ($debug_enabled) { if ($debug_enabled) {
_debug("af_pennyarcade: Processing news post"); _debug("af_pennyarcade: Processing news post");
} }
@ -73,11 +65,7 @@ class Af_Comics_Pa extends Af_ComicFilter {
if ($basenode){ if ($basenode){
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
}
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
} }
return true; return true;

@ -6,10 +6,8 @@ class Af_Comics_Twp extends Af_ComicFilter {
} }
function process(&$article) { function process(&$article) {
$owner_uid = $article["owner_uid"];
if (strpos($article["link"], "threewordphrase.com") !== FALSE) { if (strpos($article["link"], "threewordphrase.com") !== FALSE) {
if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -23,12 +21,8 @@ class Af_Comics_Twp extends Af_ComicFilter {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
return true; return true;
} }

@ -16,9 +16,6 @@ class Af_Fsckportal extends Plugin {
} }
function hook_article_filter($article) { function hook_article_filter($article) {
$owner_uid = $article["owner_uid"];
if (strpos($article["plugin_data"], "fsckportal,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@ -41,12 +38,8 @@ class Af_Fsckportal extends Plugin {
} }
$article["content"] = $doc->saveXML(); $article["content"] = $doc->saveXML();
$article["plugin_data"] = "fsckportal,$owner_uid:" . $article["plugin_data"];
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
return $article; return $article;
} }

@ -17,7 +17,6 @@ class Af_Habr extends Plugin {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "habrahabr.ru") !== FALSE) { if (strpos($article["link"], "habrahabr.ru") !== FALSE) {
if (strpos($article["plugin_data"], "af_habr,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -31,12 +30,8 @@ class Af_Habr extends Plugin {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "af_habr,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
} }
return $article; return $article;

@ -19,7 +19,6 @@ class Af_NatGeo extends Plugin {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "nationalgeographic.com") !== FALSE) { if (strpos($article["link"], "nationalgeographic.com") !== FALSE) {
if (strpos($article["plugin_data"], "natgeo,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -39,12 +38,8 @@ class Af_NatGeo extends Plugin {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "natgeo,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
} }
return $article; return $article;

@ -15,12 +15,8 @@ class Af_RedditImgur extends Plugin {
} }
function hook_article_filter($article) { function hook_article_filter($article) {
$owner_uid = $article["owner_uid"];
$force = false;
if (strpos($article["link"], "reddit.com/r/") !== FALSE) { if (strpos($article["link"], "reddit.com/r/") !== FALSE) {
if (strpos($article["plugin_data"], "redditimgur,$owner_uid:") === FALSE || $force) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML($article["content"]); @$doc->loadHTML($article["content"]);
@ -123,11 +119,7 @@ class Af_RedditImgur extends Plugin {
if ($node && $found) { if ($node && $found) {
$article["content"] = $doc->saveXML($node); $article["content"] = $doc->saveXML($node);
if (!$force) $article["plugin_data"] = "redditimgur,$owner_uid:" . $article["plugin_data"];
}
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
} }
} }

@ -19,7 +19,6 @@ class Af_SciAm extends Plugin {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "scientificamerican.com") !== FALSE || strpos($article["link"], "rss.sciam.com") !== FALSE) { if (strpos($article["link"], "scientificamerican.com") !== FALSE || strpos($article["link"], "rss.sciam.com") !== FALSE) {
if (strpos($article["plugin_data"], "sciam,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"])); @$doc->loadHTML(fetch_file_contents($article["link"]));
@ -33,12 +32,8 @@ class Af_SciAm extends Plugin {
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);
$article["plugin_data"] = "sciam,$owner_uid:" . $article["plugin_data"];
} }
} }
} else if (isset($article["stored"]["content"])) {
$article["content"] = $article["stored"]["content"];
}
} }
return $article; return $article;

@ -24,8 +24,6 @@ class Af_Unburn extends Plugin {
strpos($article["link"], "/~r/") !== FALSE || strpos($article["link"], "/~r/") !== FALSE ||
strpos($article["link"], "feedsportal.com") !== FALSE)) { strpos($article["link"], "feedsportal.com") !== FALSE)) {
if (strpos($article["plugin_data"], "unburn,$owner_uid:") === FALSE) {
if (ini_get("safe_mode") || ini_get("open_basedir")) { if (ini_get("safe_mode") || ini_get("open_basedir")) {
$ch = curl_init(geturl($article["link"])); $ch = curl_init(geturl($article["link"]));
} else { } else {
@ -42,7 +40,7 @@ class Af_Unburn extends Plugin {
curl_setopt($ch, CURLOPT_PROXY, _CURL_HTTP_PROXY); curl_setopt($ch, CURLOPT_PROXY, _CURL_HTTP_PROXY);
} }
$contents = @curl_exec($ch); @curl_exec($ch);
$real_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); $real_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
@ -73,9 +71,6 @@ class Af_Unburn extends Plugin {
$article["plugin_data"] = "unburn,$owner_uid:" . $article["plugin_data"]; $article["plugin_data"] = "unburn,$owner_uid:" . $article["plugin_data"];
$article["link"] = $real_url; $article["link"] = $real_url;
} }
} else if (isset($article["stored"]["link"])) {
$article["link"] = $article["stored"]["link"];
}
} }
return $article; return $article;

Loading…
Cancel
Save