-
Website
http://www.benjamingolub.com/ -
Original page
http://benjamingolub.com/2008/05/09/how-to-use-the-rssmeme-api-to-pull-notes-into-wordpress/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Yuvi Panda
2 comments · 6 points
-
EricaJoy
2 comments · 3 points
-
Daniel Ha
1 comment · 396 points
-
m1ck
4 comments · 1 points
-
golfman_story
2 comments · 3 points
-
-
Popular Threads
-
Very disappointed with Sprint - Benjamin Golub
1 week ago · 4 comments
-
test - Benjamin Golub
2 weeks ago · 6 comments
-
Very disappointed with Sprint - Benjamin Golub
Disqus won't allow the code so I threw it on http://www.shorttext.com/mesmfpw
I don't think the $comments = $obj5->{'entries'}->{'feeds'}->{'notes'}->{'content'}; is correct at grabbing all the notes.
notes is a list. So you have to iterate over each of them. But you've also
got the heirarchy wrong. It looks like this:
{
'entries':
[
{
'feeds': []
'notes':
[
{
'feed':
'content':
}
]
},
{
'feeds': []
},
]
}
My PHP is rusty but it'll be something like this:
foreach($entry in $json['entries]) {
foreach($note in $entry['notes'])
$name = $note['feed']['name'];
$content = $note['content']
}
Makes sense?
Do you guys know if anyone has made the request to put a code tag in Disqus yet? It shouldn't be that hard. I'll tweet Daniel.
foreach($json['entries'] as $entry) {
foreach($entry['notes'] as $note) {
echo $note['feed']['name'];
echo " - ".$note['content'];
}
}