www.webdeveloper.com
Results 1 to 4 of 4

Thread: Where do I start if I want to parse JSON data from services like Facebook?

  1. #1
    Join Date
    Aug 2007
    Posts
    5

    Where do I start if I want to parse JSON data from services like Facebook?

    Hello,

    There is a wordpress plugin called Facebook Walleria, but it is poorly maintained and a little buggy. It embeds every object from a facebook feed, including likes and comments, while making it possible to like and comment posts from the website without having to go back to facebook. I thought I should learn to develop such a plugin myself. However, I don't even know where to begin. I am starting the Javascript course on Codecademy, then moving on to PHP, and then I was going to check out some youtube tutorials on parsing JSON data from Fcebook graph API.

    Any idea of what terms, patterns, techniques I should be looking into to to create such a product? Any references that might help me out? For now I want to be able to spot the building blocks of such a product so as to get an outline of what I should aim to achieve. I'm only familiar with html/css and have no programming experience though I'm starting to learn.

    Thank you.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,246
    Well, if you want to build a WP plug-in, you're normally looking at a bunch of PHP code (and perhaps some JavaScript on any client-side stuff associated with that plug-in. Fortunately, modern JavaScript basically handles JSON natively, so there's nothing you have to do to "parse" it -- you just need to learn how to work with JSON within JS. PHP has a built-in function called json_decode() which allows you to convert any valid JSON string into a native PHP object and/or array (depending on what you set the optional 2nd parameter to), at which point it's simple to work with -- once you know how to work with objects and/or arrays in PHP.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2007
    Posts
    5
    Indeed I will seek to learn both PHP and Javascript. But in order to create a plugin of the kind I want, are there advanced programming concepts involved that might be too daunting for a beginner? One main reason I ask this is because there are quite a few plugins that embed facebook feeds on external websites, but only one (the facebook walleria) http://zoxion.com/walleria/wall-demo/ has the "like" and commenting functionality, surprisingly no other dev has included that in their plugin, so I figured maybe this is a pretty difficult process that will require extra patience on my part.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,246
    I have never tried creating a WP plug-in, so don't really know exactly how difficult, but I suspect it will be rather daunting for a novice -- probably depending on how much you need to build from scratch versus whether there's an existing plug-in you could just tweak a bit (once you figure out where in which file the tweaking is needed).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles