';
if(!$_POST['username']){
$u = get_forrst_posts('crassiusneo');
$_POST['username']='crassiusneo';
$thepage.='
Hi, This script will grab the public posts for a Forrst User.
It uses the API V2 that has this basic functionality available now.
Due to requests for using Curl for all of it I included API V2 usage for grabbing the user info as well which replaces Tutorial 1 which did not use the Curl functions.
Below are the Posts grabbed from my own Posts page, but type in a Username above and you can grab theirs too.
';
}else{
$u = get_forrst_posts($_POST['username']);
}
if(isset($u['error']) || $u==''){
if($u=='') $u['error']='Not Found.';
$thepage.='
Your request for data about username: '.$_POST['username'].' failed. Reason: '.$u['error'].'
';
}else{
if(count($u)>0){
$posts.='
Posts for '.$_POST['username'].'.
';
foreach($u as $p){
$posts.='
'.$p['posted'].'
'.$p['title'].'
'.$p['subtitle'].'
'.$p['description'].'
';
}
$posts.='
';
}
}
$thepage.=$posts.'