Created
December 3, 2009 11:59
-
-
Save rmccue/248095 to your computer and use it in GitHub Desktop.
A quick demo of how to get comments for a Blogger post with SimplePie.
This file contains 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 | |
$sp = new SimplePie('http://example.com', './cache'); | |
foreach($sp->get_items() as $item) { | |
echo '<h2>' . $item->get_title() . '</h2>'; | |
$link = $item->get_link(0, 'replies'); | |
if($link) { | |
$comments = new SimplePie($link); | |
foreach($comments->get_posts() as $comment) { | |
echo 'Comment: ' . $comment->get_content(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment