+ return $xmlDoc;
+ }
+
+ /**
+ * Convert the site content to RSS.
+ */
+ public function tweep($src_url) {
+ $url = parse_url($src_url);
+ if (FALSE === $url || empty($url["host"])) {
+ trigger_error("Invalid URL: $src_url", E_USER_ERROR);
+ return NULL;
+ }
+
+ // Strip the leading www. to be more forgiving on input URLs.
+ $host = preg_replace('/^www\./', '', $url["host"]);
+
+ $xsltProcessor = $this->loadStylesheet($host);
+ if (NULL === $xsltProcessor) {
+ return NULL;
+ }
+
+ $html = $this->getContents($src_url);
+ if (FALSE === $html) {
+ return NULL;
+ }
+
+ $preprocess_html_host_method = 'preprocess_html_' . str_replace(".", "_", $host);
+ if (method_exists($this, $preprocess_html_host_method)) {
+ $html = call_user_func_array(array($this, $preprocess_html_host_method), array($html));
+ }
+
+ $xmlDoc = $this->htmlToXml($html, $host);
+ if (NULL === $xmlDoc) {
+ return NULL;
+ }
+