Campgrounds: NM, NY, NC, ND
New Mexico
State Park campgrounds State Park reservations
New York
State Park campgrounds State Park reservations State Park brochures
North Carolina
State Park campgrounds State Park reservations State Park brochures
Current Events
// Your twitter username.
$username = "NCFSP";
$no_of_tweets = 5;
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=" . $no_of_tweets;
$xml = simplexml_load_file($feed);
foreach($xml->children() as $child) {
foreach ($child as $value) {
if($value->getName() == “link”) {
$link = $value['href'];
}
if($value->getName() == “content”) {
$content = $value . “
“;
echo ‘
}
if($value->getName() == “updated”) {
$updated = $value;
$updatedunix = strtotime($updated);
$updated = date(” g:i a F j, Y”, $updatedunix);
$time = time();
$time_period = $time – $updatedunix;
if($time_period < 60) {
//Seconds
$seconds = $time_period;
if($seconds == 1) {
$updated = 'tweeted ' .$seconds. ' second ago';
} else {
$updated = 'tweeted ' .$seconds. ' seconds ago';
}
} else if ($time_period < 3600) {
//Minutes
$minutes = floor(($time_period / 60));
$seconds = floor($time_period - $minutes * 60);
if($minutes == 1) {
if($seconds == 1) {
$updated = 'tweeted ' .$minutes. ' minute, ' . $seconds . ' second ago';
} else {
$updated = 'tweeted ' .$minutes. ' minute, ' . $seconds . ' seconds ago';
}
} else {
if($seconds == 1) {
$updated = 'tweeted ' .$minutes. ' minutes, ' . $seconds . ' second ago';
} else {
$updated = 'tweeted ' .$minutes. ' minutes, ' . $seconds . ' seconds ago';
}
}
} else if ($time_period < 86400) {
//Hours
$minutes = ($time_period / 60);
//echo $minutes;
$hours = floor(($minutes / 60));
//echo $hours;
$minutes = floor($minutes - ($hours * 60));
if($hours == 1) {
if($minutes == 1) {
$updated = 'tweeted ' .$hours. ' hour, ' . $minutes . ' minute ago';
} else {
$updated = 'tweeted ' .$hours. ' hour, ' . $minutes . ' minutes ago';
}
} else {
if($minutes == 1) {
$updated = 'tweeted ' .$hours. ' hours, ' . $minutes . ' minute ago';
} else {
$updated = 'tweeted ' .$hours. ' hours, ' . $minutes . ' minutes ago';
}
}
} else if ($time_period > 86400) {
//Days
$minutes = ($time_period / 60);
$hours = floor(($minutes / 60));
$days = floor(($hours / 24));
$hours = floor($hours – ($days * 24));
if($days == 1) {
if($hours == 1) {
$updated = ‘tweeted ‘ .$days. ‘ day, ‘.$hours.’ hour ago’;
} else {
$updated = ‘tweeted ‘ .$days. ‘ day, ‘.$hours.’ hours ago’;
}
} else {
if($hours == 1) {
$updated = ‘tweeted ‘ .$days. ‘ days, ‘.$hours.’ hour ago’;
} else {
$updated = ‘tweeted ‘ .$days. ‘ days, ‘.$hours.’ hours ago’;
}
}
}
echo ‘
‘;
}
}
}
?>
North Dakota
State Park campgrounds State Park reservations State Park brochures
Stay updated on new posts by subscribing to my RSS feed. To get additional tips delivered right to your inbox, sign up for my free monthly newsletter, which also includes my free six-page guide to cold weather gear!

Comments on this entry are closed.