diff --git a/bridges/ArstechnicaBridge.php b/bridges/ArstechnicaBridge.php new file mode 100644 index 0000000..f9a7398 --- /dev/null +++ b/bridges/ArstechnicaBridge.php @@ -0,0 +1,79 @@ +maintainer = "prysme"; + $this->name = "ArstechnicaBridge"; + $this->uri = "http://arstechnica.com"; + $this->description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion"; + $this->update = "01/08/2016"; + + } + + public function collectData(array $param) { + function StripWithDelimiters($string, $start, $end) { + while (strpos($string, $start) !== false) { + $section_to_remove = substr($string, strpos($string, $start)); + $section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end)); + $string = str_replace($section_to_remove, '', $string); + } return $string; + } + function StripCDATA($string) { + $string = str_replace('', '', $string); + return $string; + } + + function ExtractContent($url) { + #echo $url; + $html2 = file_get_html($url); + + $text = $html2->find("section[id='article-guts']", 0); + /*foreach ($text->find('