public
Last active

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php $download=json_decode(wp_remote_retrieve_body(wp_remote_get('http://www.reddit.com/r/Wordpress/comments/1a23de/reddit_comments/.json')));
foreach ($download as $comments){
?><ul><?php
foreach ($comments->data->children as $comment){
if($comment->data->body != null){
?><li><a href="http://www.reddit.com/user/<?php echo($comment->data->author)?>" target="_blank">
<?php echo html_entity_decode($comment->data->author); ?></a><br /><?php
echo html_entity_decode($comment->data->body); ?></li><br /><br /><ul><?php
foreach($comment->data->replies->data->children as $reply){
?><li><a href="http://www.reddit.com/user/<?php echo($reply->data->author)?>" target="_blank">
<?php echo html_entity_decode($reply->data->author); ?></a><br /><?php
echo html_entity_decode($reply->data->body_html); ?></li><br /><?php
} ?></ul><?php
}
} ?></ul><?php
}
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.