From 89726167483fb68b16955d587cf7736f3b404921 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 13 Dec 2022 12:38:43 -0600 Subject: Initial commit --- superstack.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 superstack.php diff --git a/superstack.php b/superstack.php new file mode 100644 index 0000000..84d0a04 --- /dev/null +++ b/superstack.php @@ -0,0 +1,48 @@ +loadHTML($page); +$title = $doc->getElementsByTagName('title')[0]->textContent; +?> + + + <?= $title ?> -- Superstack + + + +' . $title . ''; +echo '

' . $site . ''; +echo ' [orig]

'; + +$content = $doc->getElementsBytagName('div'); + +foreach ($content as $el) { + if (stripos($el->getAttribute('class'), 'body') !== false) { + + $ret = new DOMDocument(); + $node = $ret->importNode($el, true); + $ret->appendChild($node); + echo $ret->saveHTML(); + + // echo $el->nodeValue; + // echo ''; + // echo '' . $el->getAttribute('class') . ''; + // echo '' . stripos($el->getAttribute('class'), 'body') . ''; + // echo ''; + } +} + +?> + + + -- cgit 1.4.1-21-gabe81