"; /* CREATE TABLE `chorbuch` ( `CBID` int(11) NOT NULL, `Nr` int(10) NOT NULL DEFAULT '0', `Titel` mediumtext COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lieder im Chorbuch'; ALTER TABLE `chorbuch` ADD PRIMARY KEY (`CBID`); ALTER TABLE `chorbuch` MODIFY `CBID` int(11) NOT NULL AUTO_INCREMENT; CREATE TABLE `chorbuch_texte` ( `CBID` int(11) NOT NULL, `Text` mediumtext COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; truncate table chorbuch; truncate table chorbuch_texte; */ for($i=2897; $i<=3238; $i++){ #echo "http://anonymouse.org/cgi-bin/anon-www_de.cgi/http://www.nak-gesangbuch.de/index.php?html=dechbhym$i
"; $url = "http://anonymouse.org/cgi-bin/anon-www_de.cgi/http://www.nak-gesangbuch.de/index.php?html=dechbhym$i"; $handle = file_get_contents($url); # $handle=file_get_contents("testseite4.html"); $handle = strstr($handle, '

'); $handle = strstr($handle, '
', true); # Headline H0 $pos_ab = "27"; $pos_bis = ""; $handle2 = ""; $handle3 = ""; $text = ""; $nummer = ""; $headline = ""; $handle2 = substr($handle, $pos_ab); $pos_bis = strpos($handle2, '

'); $name = trim(substr($handle2, 0, $pos_bis)); $headteiler = explode("     ", $name); $nummer = trim($headteiler[0]); $headline = trim($headteiler[1]); # Body $pos_ab2 = "22"; #
$handle3 = strstr($handle, '
'); $text = trim(substr($handle3, $pos_ab)); #echo $text; $db = dbconnect(); $db->query("SET NAMES 'utf8'"); $headline = $db->real_escape_string($headline); $text = $db->real_escape_string($text); $sql1 = $db->query("INSERT INTO chorbuch ( Nr , Titel ) VALUES ( '$nummer' , '$headline' )"); $cbid = $db->insert_id; $sql1 = $db->query("INSERT INTO chorbuch_texte ( CBID , Text ) VALUES ( '$cbid' , '$text' )"); # Zufällige Anzahl Sekunden pausieren # $random = rand(3, 10); # sleep($random); echo "$nummer --> $headline
"; } #echo ""; ?>