Skip to content

Instantly share code, notes, and snippets.

@jamsesso
Created March 13, 2010 00:12
Show Gist options
  • Save jamsesso/330964 to your computer and use it in GitHub Desktop.
Save jamsesso/330964 to your computer and use it in GitHub Desktop.
<?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