Created
March 13, 2010 00:12
-
-
Save jamsesso/330964 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Configuration variables, edit accordingly */ | |
$username = "cloudica"; | |
$domain = "cloudi.ca"; //Alternative is cloudica.net | |
$max_posts = "10"; //Leave empty for all available posts. | |
/* Fetch the posts and loop. */ | |
$xml = simplexml_load_file("http://".$domain."/feeds/".$username.".rss"); | |
if(!empty($max_posts)) | |
{ | |
$num_posts = $max_posts; | |
} | |
else | |
{ | |
$num_posts = count($xml->channel->item) - 1; | |
} | |
for($i = 1; $i <= $num_posts; $i++) | |
{ | |
/* Echo the post */ | |
echo '<div class="cloudica_post" id="'.end(explode("-", $xml->channel->item[$i]->guid)).'">'.$i.'. '.stripslashes($xml->channel->item[$i]->description).'</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment