Parsemeta.php
From Wiki2
#!/usr/bin/php -w <? //$fname = $argv[1];//still working to make this run from command line args $fname = '2ism/v/tfa.txt'; $lines = file($fname)or die("yo can't open file \n"); $outFile = "2ism/v/tfaWikiv.txt"; $fh = fopen($outFile, 'w') or die("can't open file"); // Loop through $lines array, lookup meta description tag for def of each $wrd. foreach ($lines as $line_num => $wrd) { $tags = get_meta_tags('http://www.answers.com/'.$wrd); $thedef = $tags['description']."\n";//pick out the description tag and keep the string $thewords = explode(" ", $thedef);//explode it $thewords[0]=";".$thewords[0].":";//put the first word in wiki format $wikidef = implode(" ",$thewords)."\n";//put the string back together fwrite($fh, $wikidef); echo $wikidef; } fclose($fh); ?>