addHeaderLine("Referer", "www.ovikefs.se"); $be->addHeaderLine("Accept-Encoding", "x-compress; x-zip"); $be->addHeaderLine("Content-Type", "application/x-www-form-urlencoded"); //******************************************************************************************** $patternsize=$_POST['patternsize']; $url=$_POST['url']; $start_in_tag_array_post=$_POST['start_in_tag_array']; $expand_below=$_POST['expand_below']; $expand_over=$_POST['expand_over']; $weekday_filter=$_POST['weekday_filter']; $event_pattern=$_POST['event_pattern']; $pattern_position=$_POST['pattern_position']; $year_pattern=$_POST['year_pattern']; $month_pattern=$_POST['month_pattern']; $day_pattern=$_POST['day_pattern']; //$upper_week = $this_week+3; //for ($week = $this_week; $week <$upper_week; $week++) { // if ($week > 53){ // $week=1; //} //echo $week; //$be->addPostData("vecka", $week); //$be->addPostData("month", $month); //$be->addPostData("menu1", "index.php?month=3"); //$be->addPostData("month", 8 ); //$be->addPostData("year", 2009); //$url="http://www.bonhuset.com/program_index.asp"; //$url="http://www.bonhuset.com/"; //$url="http://www.pingst-ovik.se/"; //$url="http://www.tronsskold.se/"; // Example: fetch a web page and display the return headers and // the contents of the page (html-escaped): /*include "Snoopy.class.php"; $snoopy = new Snoopy; //$snoopy->user = "joe"; //$snoopy->pass = "bloe"; if($snoopy->fetch($url)) { $snoopy->fetch($url); echo "response code: ".$snoopy->response_code."
\n"; while(list($key,$val) = each($snoopy->headers)) echo $key.": ".$val."
\n"; echo "

\n"; echo "

".htmlspecialchars($snoopy->results)."
\n"; } else echo "error fetching document: ".$snoopy->error."\n"; */ $file = $be->fopen($url); $response = $be->getLastResponseHeaders(); //print_r($response); $urlstring=get_urlstring($url,$file,"","","alltags"); //echo $urlstring."

"; //get_pattern_from_urlstring($urlstring); $pattern="((<([a-zA-Z/]{0,5})([^<>]*)>)|(<([a-zA-Z/]{0,5})([^<>]*)))"; $tag_array=identify_tags($urlstring,$pattern); $taged_string= replace_with_nr_tags($urlstring,$pattern,$tag_array); //$trimed_urlstring=str_replace("\r\n","",$urlstring); //echo $trimed_urlstring; //print_r($tag_array); $pattern_tag_range=array(); $pattern_tag_range[0]["size_pattern"]= $patternsize; $pattern_tag_range[0]["low_tag_item"]= -1; $start_in_tag_array=$start_in_tag_array_post; //$expand_below=0; //$expand_over=0; //for($d=0; $d<15; $d++) { while ($pattern_tag_range[0]["size_pattern"]>1) { $pattern_tag_range=get_pattern_from_tag_array($tag_array,$pattern_tag_range,$start_in_tag_array,$taged_string,$expand_below,$expand_over,$weekday_filter,$event_pattern,$pattern_position,$year_pattern,$month_pattern,$day_pattern); // print_r($pattern_tag_range); echo "
".$pattern_tag_range[0]["size_pattern"]."
"; //print_text_in_tag_range($taged_string,$pattern_tag_range); } //$reg_exp=build_reg_exp($pattern_tag_range,$tag_array); /*$company=7; if (strlen($urlstring)>50 ){ if(insert_data_in_db($url,$town=1,$category=2,$company,$urlstring, $year, 0,0, $week, $link,$search_type=5,date("Y-m-d"),$sortorder=2001)){ delete_data_in_db($company,$link); } } else { send_mail("jerker.bergman@gmail.com","Urlstring error","URLsring to short p� ".$url); } //}*/ fclose($file); ?>