lol... i am a fing dumb ass!!!!!!!!!!!! holy shit!
ok... i tried to just opent he first bunch of the file and get the vars for one set... this is what I ran:
$fp = fopen ("content.rdf.u8.ascii", "r");
$buffer=fread($fp, 102400);
$start= strpos($buffer, "<ExternalPage about=\"");
$finish= strpos($buffer, "\">");
$length= $finish-$start;
$url=Substr($buffer, $start, $length);
echo "URL=$url<BR>";
$start= strpos($buffer, "<d:Title>");
$finish= strpos($buffer, "</d:Title>");
$length= $finish-$start;
$title=Substr($buffer, $start, $length);
echo "Title=$title<BR>";
$start= strpos($buffer, "<d:Description>");
$finish= strpos($buffer, "</d:Description>");
$length= $finish-$start;
$description=Substr($buffer, $start, $length);
echo "Description=$description<BR>";
echo "$title, $url, $description<BR><BR>\n\n";
fclose($fp);
I got a HUGE bunch of SHIT because the problem is the URL expression... what I need is someone to tell me how to get this idea to work:
$fp = fopen ("content.rdf.u8.ascii", "r");
$buffer=fread($fp, 102400);
-NEED HELP HERE
How do I get it to select the information between the quotes of the <ExternalPage about="[url]"> tag... for example it would extract [url] from that like and save that as the variable url ( $url="[url]";
-SEE WHAT I MEAN???
$length= $finish-$start;
$url=Substr($buffer, $start, $length);
$start= strpos($buffer, "<d:Title>");
$finish= strpos($buffer, "</d:Title>");
$length= $finish-$start;
$title=Substr($buffer, $start, $length);
$start= strpos($buffer, "<d:Description>");
$finish= strpos($buffer, "</d:Description>");
$length= $finish-$start;
$description=Substr($buffer, $start, $length);
Then... once that is figured out... how would i make it loop this through the file and extract only when there is full tags ... such as this reasoning (not this syntax):
foreach($start= strpos($fd, "<ExternalPage"; $finish= strpos($fd, "</ExternalPage>"); $length= $finish-$start; $buffer=Substr($fd, $start, $length);) {
-NEED HELP HERE
How do I get it to select the information between the quotes of the <ExternalPage about="[url]"> tag... for example it would extract [url] from that like and save that as the variable url ( $url="[url]";
-SEE WHAT I MEAN???
$length= $finish-$start;
$url=Substr($buffer, $start, $length);
$start= strpos($buffer, "<d:Title>");
$finish= strpos($buffer, "</d:Title>");
$length= $finish-$start;
$title=Substr($buffer, $start, $length);
$start= strpos($buffer, "<d:Description>");
$finish= strpos($buffer, "</d:Description>");
$length= $finish-$start;
$description=Substr($buffer, $start, $length);
mysql_query("INSERT INTO links VALUES("","$url","$title","$description")");
}
fclose($fp);
The problem is... how do i get php to read a chunk of the file and parse up to the last full <externalpage></externalpage> set and then mark its position at the end of that </externalpage>, then continue reading, starting at that set mark, -you know.. make it read it with a buffer, but not get partial tags, and continue where left off... PLZ!! I AM VERY HANDYCAPPED AND MY CODE IS F*ED TO HELL... PZL PLZ READ ... TRY TO UNDERSTAND IT, AND RE-WRITE THE CODE TO DO THIS!!! PPPPPLLLLLZZZZZ... I WILL DO ANYTHING... GIVE YOU THE DATABASE OR ANYTHING!!!