Herzlich willkommen im Archiv vom ABAKUS Online Marketing Forum
Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.
Aber ja, da gibt es reichlich Scripte und Ansätze.Luigi hat geschrieben:Hallo!
Ich suche einen Parser für eine Suchmaschine, der den Inhalt einer Webseite feststellt und in eine Datenbank packt.
Ein System, vergleichbar mit Google, das mir sagt, dass auf der Webseite xy ein Text zum Thema Handy, Klingeltöne etc. steht.
Gibt es sowas als Script oder so?
Gruß
Lugii
Code: Alles auswählen
function text_cut($text, $from, $to,$replace='')
{
$cut='';
$pos1 = strpos($text,$from);
if ( $pos1 )
{
$pos2 = strpos($text,$to,$pos1);
if ( $replace )
return(substr($text,0,$pos1).$replace.substr($text,$pos2+1));
if ( $pos2 )
$cut = substr($text,$pos1,$pos2-$pos1+1);
}
return($cut);
}
function text_cutcontent($text, $from, $to)
{
$cut='';
$pos1 = strpos($text,$from);
if ( $pos1 )
{
$pos2 = strpos($text,$to,$pos1);
$pos1 += strlen($from);
if ( $pos2 )
$cut = substr($text,$pos1,$pos2-$pos1);
}
return($cut);
}
function text_replace($text, $cut, $replace)
{
return(str_replace($cut,$replace,$text));
}
$buffer = file_get_contents( $http );
$body = text_cutcontent( $buffer, '<bod', '</bod');
$contentBodyStart=strpos($body,'>');
$content = substr( $body, $contentBodyStart+1);