DISQUS

DISQUS Hello! benjamingolub.com is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

How to Use the RSSmeme API to Pull Notes into Wordpress

Started by Benjamin Golub · 1 year ago

I’d like for someone to write a Wordpress plugin that will pull all of the notes for an article out of RSSmeme.  The JSON API is now ready for it.  Here’s a quick “how to” to get your rolling:
Build your URL.  You want to operate on http://www.rssmeme.com/recent/ so you have no “built in” filter on [...] ... Continue reading »

6 comments

  • I'm trying to put something together that pulls in the name & comment. My JSON to PHP skills are weak so I could use some help if you know how...

    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.
  • No that won't work. Remember that entries is a list, feeds is a lit, and
    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?
  • Sigh; Disqus messes with the whitespace but you get the idea.
  • Another cool application of RSSmeme, I like!
    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.
  • Thanks! I just had to change a few things, but you gave me the right direction.

    foreach($json['entries'] as $entry) {
    foreach($entry['notes'] as $note) {
    echo $note['feed']['name'];
    echo " - ".$note['content'];
    }
    }
  • Glad you were able to get it working.

Add New Comment

Returning? Login