"); // While you find relevant links while (strpos($contents, "\n\n\n"); fwrite ($fp, "AI Forums\n"); fwrite ($fp, "http://www.ai-forum.org/topic.asp?forum_id=1\n"); fwrite ($fp, "AI Discussion\n"); fwrite ($fp, "en-us\n"); fwrite ($fp, "http://www.daxamite.com/rss/aiforumrss.xml\n"); // For each post found, create an RSS item with all the relevant info for ($i=0; $i\n"); $headline = substr($article[1][$i], (strpos($article[1][$i],"green11n'>")+10), (strpos($article[1][$i],""))-(strpos($article[1][$i],"green11n'>")+10) ); $item_link = "http://www.ai-forum.org/" . substr($article[1][$i], 9, (strpos($article[1][$i],"' class"))-9 ); // Freaky RSS Standards thing... If you don't do this next step it will explode. $item_link = str_replace("&","&",$item_link); $timestr = strtotime(str_replace(" ", " ", $article[2][$i])); fwrite ($fp, "$headline\n"); fwrite ($fp, "$item_link\n"); fwrite ($fp, "".date("D, j M Y G:i:s",$timestr)." GMT\n"); fwrite ($fp, "\n"); } // Finish the RSS file fwrite ($fp, "\n"); fclose ($fp); } else { die( "Could not open AI Forum!" ) ; } ?>