Skip to content

Instantly share code, notes, and snippets.

@johntron
Created May 15, 2013 02:34
Show Gist options
  • Save johntron/5581284 to your computer and use it in GitHub Desktop.
Save johntron/5581284 to your computer and use it in GitHub Desktop.
$feed = $this->get('feed_parser'); // This is just a SimplePie object
$feed->set_feed_url('http://feeds.feedburner.com/lolcats/rss');
$feed->init();
$items = $feed->get_items();
$item = $items[array_rand($items)];
$item = $item->get_content();
$item = substr($item, 0, strpos($item, 'Posted by'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment