]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_comics/filters/af_comics_twp.php
2 class Af_Comics_Twp
extends Af_ComicFilter
{
5 return array("Three Word Phrase");
8 function process(&$article) {
9 $owner_uid = $article["owner_uid"];
11 if (strpos($article["link"], "threewordphrase.com") !== FALSE) {
12 if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
14 $doc = new DOMDocument();
15 @$doc->loadHTML(fetch_file_contents($article["link"]));
20 $xpath = new DOMXpath($doc);
22 $basenode = $xpath->query("//td/center/img")->item(0);
25 $article["content"] = $doc->saveXML($basenode);
26 $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
29 } else if (isset($article["stored"]["content"])) {
30 $article["content"] = $article["stored"]["content"];