Here is a piece of PHP code i use to screen scrape the main page for the latest posts.
An RSS feed would have made life much easier...
---start cross site scripting bug here--- *hint hint for web developer*
### Large chunk missing that grabs the URL, caches it, builds an array and a foreach loop
if($site=="Chockstone"){ ### Chockstone
if(strstr($line,"Latest Forum Messages")){$go=1;}
if($go==1 && strstr($line,"/Forum/Forum.asp")){
if(!strstr($line,"More")){
$line=str_replace(" "," ",$line);
$line=str_replace("\r","",$line);
$line=str_replace("/Forum/","http://www.chockstone.org/Forum/",$line);
$line=str_replace("&","&",$line);
$line=str_replace("&","&",$line);
$line=str_replace("&","&",$line);
if(strstr($line,"Go To Last Page")){ }
else{
$line=str_replace('#newpost','&MsgPagePos=-1#newpost',$line);
$out.="<tr><td>$line</td></tr>\n";
}
}
}
if(strstr($line,"Picture.asp")){$go=0;}
}
---end cross site scripting bug--- |