+ return $xmlDoc;
+ }
+
+ 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->load_stylesheet($host);
+ if (NULL === $xsltProcessor) {
+ return NULL;
+ }
+
+ $html = $this->get_contents($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->html_to_xml($html, $host);
+ if (NULL === $xmlDoc) {
+ return NULL;
+ }
+